-
|
When I close a window in a multi-window application, // WindowBase is the base class of all windows
// One window may has multiple documents
WindowBase::~WindowBase() {
Rml::RemoveContext(windowName);
Rml::ReleaseTextures(renderInterface);
delete renderInterface;
glfwDestroyWindow(glfwWindow);
}VisualStudio prompts me that there is an exception with the following RmlUi code // Core\EventDispatcher.cpp
// Detaches all events from this dispatcher and all child dispatchers.
void EventDispatcher::DetachAllEvents()
{
for (const auto& event : listeners)
event.listener->OnDetach(element); // This line has exception
listeners.clear();
for (int i = 0; i < element->GetNumChildren(true); ++i)
element->GetChild(i)->GetEventDispatcher()->DetachAllEvents();
}The exception is:
The event and element both have value. What's wrong with my code, Thanks very much! |
Beta Was this translation helpful? Give feedback.
Answered by
barotto
Jan 18, 2023
Replies: 1 comment 1 reply
-
|
Make sure event listeners attached to any element of documents in the context are kept alive until the call to |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
xland
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make sure event listeners attached to any element of documents in the context are kept alive until the call to
Rml::RemoveContext().