File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ FindDispatcherHost(content::RenderViewHost* render_view_host) {
67
67
return it->second ;
68
68
}
69
69
70
+ void DispatcherHost::ClearObjectRegistry () {
71
+ objects_registry_.Clear ();
72
+ }
73
+
70
74
Base* DispatcherHost::GetApiObject (int id) {
71
75
return objects_registry_.Lookup (id);
72
76
}
Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ class DispatcherHost : public content::RenderViewHostObserver {
59
59
return static_cast <T*>(GetApiObject (id));
60
60
}
61
61
62
+ static void ClearObjectRegistry ();
63
+
62
64
// Send event to C++ object's corresponding js object.
63
65
void SendEvent (Base* object,
64
66
const std::string& event,
Original file line number Diff line number Diff line change @@ -202,8 +202,13 @@ Shell::~Shell() {
202
202
}
203
203
}
204
204
205
- if (windows_.empty () && quit_message_loop_)
205
+ if (windows_.empty () && quit_message_loop_) {
206
+ // If Window object is not clearred here, the Window destructor
207
+ // will be called at exit and block the thread exiting on
208
+ // Notification registrar destruction
209
+ nwapi::DispatcherHost::ClearObjectRegistry ();
206
210
nwapi::App::Quit (web_contents ()->GetRenderProcessHost ());
211
+ }
207
212
}
208
213
209
214
void Shell::SendEvent (const std::string& event, const std::string& arg1) {
You can’t perform that action at this time.
0 commit comments