Skip to content

Commit

Permalink
Fix Refresh Issue
Browse files Browse the repository at this point in the history
* static logger pointer was being held on refresh
* set it to null when the js runtime is tearing down
  • Loading branch information
takameyer committed Jul 3, 2023
1 parent f8e1a28 commit ae71a85
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/realm/bindgen/src/templates/jsi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,8 @@ export function generate({ rawSpec, spec, file: makeFile }: TemplateContext): vo
realm::app::App::clear_cached_apps();
// Blow away the addon state.
RealmAddon::self.reset();
// Clear the default logger, to prevent it from holding on to a pointer that was released
realm::util::Logger::set_default_logger(nullptr);
}
void realm_jsi_init(jsi::Runtime& rt, jsi::Object& exports, std::function<void()> flush_ui_queue) {
realm_jsi_invalidate_caches();
Expand Down

0 comments on commit ae71a85

Please sign in to comment.