Permalink
Browse files

Don't leave an invalid pointer when deleting the main stack

  • Loading branch information...
1 parent 2699d86 commit bfbd67b438c20e9bb693a00985505b411033b5e3 Lawrence Rust committed with stuartm Jul 6, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 mythtv/libs/libmythui/mythmainwindow.cpp
View
5 mythtv/libs/libmythui/mythmainwindow.cpp
@@ -635,8 +635,11 @@ void MythMainWindow::AddScreenStack(MythScreenStack *stack, bool main)
void MythMainWindow::PopScreenStack()
{
- delete d->stackList.back();
+ MythScreenStack *stack = d->stackList.back();
d->stackList.pop_back();
+ if (stack == d->mainStack)
+ d->mainStack = NULL;
+ delete stack;
}
int MythMainWindow::GetStackCount(void)

0 comments on commit bfbd67b

Please sign in to comment.