Skip to content

Commit 8c2cf39

Browse files
committed
[CDT] object id check on closing
1 parent 45493ec commit 8c2cf39

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/nw_shell.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,10 @@ Shell::~Shell() {
185185
if (is_devtools_ && devtools_owner_.get()) {
186186
devtools_owner_->SendEvent("devtools-closed");
187187
nwapi::DispatcherHost* dhost = nwapi::FindDispatcherHost(devtools_owner_->web_contents_->GetRenderViewHost());
188-
dhost->OnDeallocateObject(devtools_owner_->devtools_window_id_);
189-
devtools_owner_->devtools_window_id_ = 0;
188+
if (devtools_owner_->devtools_window_id_) {
189+
dhost->OnDeallocateObject(devtools_owner_->devtools_window_id_);
190+
devtools_owner_->devtools_window_id_ = 0;
191+
}
190192
}
191193

192194
for (size_t i = 0; i < windows_.size(); ++i) {

0 commit comments

Comments
 (0)