Silence ubsan warnings about invalid pointer casts

REVIEW: 129343
This commit is contained in:
Martin T. H. Sandsmark
2016-11-05 18:10:47 +01:00
parent a30be88f3b
commit 66e85acbc9
3 changed files with 18 additions and 19 deletions

View File

@@ -720,8 +720,8 @@ void ViewManager::viewDestroyed(QWidget* view)
{
// Note: the received QWidget has already been destroyed, so
// using dynamic_cast<> or qobject_cast<> does not work here
TerminalDisplay* display = static_cast<TerminalDisplay*>(view);
Q_ASSERT(display);
// We only need the pointer address to look it up below
TerminalDisplay* display = reinterpret_cast<TerminalDisplay*>(view);
// 1. detach view from session
// 2. if the session has no views left, close it