UI: Defer document destruction

This commit is contained in:
Luke Street
2026-04-30 17:46:36 -06:00
parent 62edb3abc6
commit cee6a24309
4 changed files with 38 additions and 10 deletions
+7
View File
@@ -64,6 +64,13 @@ void Document::listen(Rml::Element* element, Rml::EventId event,
std::make_unique<ScopedEventListener>(element, event, std::move(callback), capture));
}
bool Document::can_destroy() const {
if (mDocument == nullptr) {
return true;
}
return *mDocument->GetProperty(Rml::PropertyId::Visibility) == Rml::Style::Visibility::Hidden;
}
bool Document::handle_nav_command(Rml::Event& event, NavCommand cmd) {
return false;
}