From 1e7a0406dc7778dff4190037bf5fa0d4438a6bcb Mon Sep 17 00:00:00 2001 From: John Scipione Date: Wed, 30 Mar 2016 16:48:59 -0700 Subject: [PATCH] DataTranslation: Fix crash just noticed this crash... when fConfigView gets deleted by selecting a translator it deletes its child fInfoText but we were leaving the pointer alone. Afterwords if you changed the panel text color in Appearance a message gets sent that checks to see if the fInfoView pointer is NULL, and since it isn't, procedes to dereference the pointer and *boom* the app crashes. Fix this by setting the fInfoText pointer to NULL when fConfig view gets deleted. That way when you change the panel text color it doesn't attempt to dereference the stale pointer and everything works as it should. --- src/preferences/datatranslations/DataTranslationsWindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/preferences/datatranslations/DataTranslationsWindow.cpp b/src/preferences/datatranslations/DataTranslationsWindow.cpp index 0ba3615068..93bce4c5f4 100644 --- a/src/preferences/datatranslations/DataTranslationsWindow.cpp +++ b/src/preferences/datatranslations/DataTranslationsWindow.cpp @@ -156,6 +156,7 @@ DataTranslationsWindow::_ShowConfigView(int32 id) fRightBox->RemoveChild(fConfigView); delete fConfigView; fConfigView = NULL; + fInfoText = NULL; if (fRelease != NULL) { fRelease->Release(); fRelease = NULL; @@ -194,6 +195,7 @@ DataTranslationsWindow::_ShowInfoView() fRightBox->RemoveChild(fConfigView); delete fConfigView; fConfigView = NULL; + fInfoText = NULL; if (fRelease != NULL) { fRelease->Release(); fRelease = NULL;