Skip to content

Commit

Permalink
Fixed use after free.
Browse files Browse the repository at this point in the history
  • Loading branch information
5cript committed Aug 29, 2023
1 parent 43aa5a3 commit c747983
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions nui/src/nui/backend/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,7 @@ extern "C" {

void uriSchemeDestroyNotify(void* data)
{
auto* schemeContext = static_cast<Nui::Window::SchemeContext*>(data);
auto impl = schemeContext->impl.lock();
if (!impl)
return;

std::lock_guard lock{impl->schemeResponseRegistryGuard};
impl->schemeResponseRegistry.erase(schemeContext->id);
// Happens when everything else is already dead.
}
}
#endif
Expand Down

0 comments on commit c747983

Please sign in to comment.