Skip to content

Commit

Permalink
fix protected values destruction on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
blagoev committed Mar 10, 2021
1 parent 8960b53 commit 9b23c55
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/realm-dart-extension/dart/dart_protected.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ class Protected {
}

try {
Dart_DeletePersistentHandle(m_ref);
Dart_Isolate isolate = Dart_CurrentIsolate();
//make sure there is current isolate. On Dart VM shutdown there might be no current isolate so just drop the handles
if (isolate != nullptr) {
Dart_DeletePersistentHandle(m_ref);
}
m_ref = nullptr;
}
catch (...) {}
Expand Down

0 comments on commit 9b23c55

Please sign in to comment.