[haiku-commits] haiku: hrev50175 - src/preferences/datatranslations

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 31 Mar 2016 01:56:37 +0200 (CEST)

hrev50175 adds 1 changeset to branch 'master'
old head: b90d36ccd650b99f5010c6637ec8ffe878bb2628
new head: 1e7a0406dc7778dff4190037bf5fa0d4438a6bcb
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=1e7a0406dc77+%5Eb90d36ccd650

----------------------------------------------------------------------------

1e7a0406dc77: 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.

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev50175
Commit:      1e7a0406dc7778dff4190037bf5fa0d4438a6bcb
URL:         http://cgit.haiku-os.org/haiku/commit/?id=1e7a0406dc77
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Wed Mar 30 23:48:59 2016 UTC

----------------------------------------------------------------------------

1 file changed, 2 insertions(+)
src/preferences/datatranslations/DataTranslationsWindow.cpp | 2 ++

----------------------------------------------------------------------------

diff --git a/src/preferences/datatranslations/DataTranslationsWindow.cpp 
b/src/preferences/datatranslations/DataTranslationsWindow.cpp
index 0ba3615..93bce4c 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;


Other related posts:

  • » [haiku-commits] haiku: hrev50175 - src/preferences/datatranslations - jscipione