Unregister shortcuts when closing windows that registered shortcuts

* This prevents leaking for cases where new widgets are created (and
  the small chance a widget pointer could be re-used and cause serious
  problems), and multiple-registration errors for global shortcuts.
This commit is contained in:
baldurk committed 2017-11-22 19:11:25 +00:00
1 parent cadc0f3855
commit 38acc56084
5 files changed
+68 -1

No files matched your search

+3
View File
@@ -585,6 +585,9 @@ ShaderViewer::~ShaderViewer()
// don't want to async invoke while using 'this', so save the trace separately
ShaderDebugTrace *trace = m_Trace;
// unregister any shortcuts on this window
m_Ctx.GetMainWindow()->UnregisterShortcut(QString(), this);
m_Ctx.Replay().AsyncInvoke([trace](IReplayController *r) { r->FreeTrace(trace); });
if(m_CloseCallback)