diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index af561e0e0..4a17c7122 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1352,7 +1352,8 @@ void CMenuWidget::calcSize() CMenuItem *separator = new CMenuSeparator(); height += separator->getHeight(); delete separator; - + separator = NULL; + //scrollbar width scrollbar_width=0; if (total_pages > 1) @@ -1617,6 +1618,7 @@ void CMenuWidget::saveScreen() return; delete[] background; + background = NULL; int hint_h = 0; if (hint_height) hint_h = OFFSET_INTER + hint_height + OFFSET_SHADOW; @@ -2141,8 +2143,8 @@ int CMenuOptionChooser::exec(CMenuTarget*) *optionValue = options[select].key; optionValname = (char *) options[select].valname; } - delete menu; - delete selector; + delete menu; menu = NULL; + delete selector; selector = NULL; } else { for(unsigned int count = 0; count < number_of_options; count++) { if (options[count].key == (*optionValue)) { @@ -2314,8 +2316,8 @@ int CMenuOptionStringChooser::exec(CMenuTarget* parent) ret = menu_return::RETURN_REPAINT; if(select >= 0 && optionValuePtr) *optionValuePtr = options[select]; - delete menu; - delete selector; + delete menu; menu = NULL; + delete selector; selector = NULL; } else { //select next value for(unsigned int count = 0; count < options.size(); count++) { @@ -2567,7 +2569,7 @@ bool CPINProtection::check() cPIN = ""; CPINInput* PINInput = new CPINInput(title, &cPIN, 4, hint); PINInput->exec( getParent(), ""); - delete PINInput; + delete PINInput; PINInput = NULL; hint = LOCALE_PINPROTECTION_WRONGCODE; } while ((cPIN != *validPIN) && !cPIN.empty()); return (cPIN == *validPIN); @@ -2586,7 +2588,7 @@ bool CZapProtection::check() CPLPINInput* PINInput = new CPLPINInput(title, &cPIN, 4, hint, fsk); res = PINInput->exec(getParent(), ""); - delete PINInput; + delete PINInput; PINInput = NULL; cPIN[4] = 0; hint = LOCALE_PINPROTECTION_WRONGCODE; diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 4c3b162f0..4050cc411 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -314,7 +314,7 @@ class CMenuDForwarder : public CMenuForwarder const char * const IconName = NULL, const char * const IconName_Info_right = NULL) : CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName, IconName_Info_right) { }; - ~CMenuDForwarder() { delete jumpTarget; } + ~CMenuDForwarder() { delete jumpTarget; jumpTarget = NULL;} }; class CAbstractMenuOptionChooser : public CMenuItem diff --git a/src/gui/widget/shellwindow.cpp b/src/gui/widget/shellwindow.cpp index 4d8829a1c..11841ad9a 100644 --- a/src/gui/widget/shellwindow.cpp +++ b/src/gui/widget/shellwindow.cpp @@ -301,4 +301,5 @@ CShellWindow::~CShellWindow() { if (textBox) delete textBox; + textBox = NULL; } diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index 75384abd3..b29f4e080 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -394,6 +394,7 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & ) if (pixBuf) delete[] pixBuf; + pixBuf = NULL; if (!parent || force_saveScreen) { pixBuf = new fb_pixel_t[(width + OFFSET_SHADOW) * (height + OFFSET_SHADOW)]; if (pixBuf) @@ -916,6 +917,7 @@ int CPLPINInput::exec( CMenuTarget* parent, const std::string & ) { frameBuffer->RestoreScreen(x - borderwidth, y- borderwidth, width+ 2* borderwidth, height+ 2* borderwidth, pixbuf); delete[] pixbuf;//Mismatching allocation and deallocation: pixbuf + pixBuf = NULL; } return ( res ); diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index 452b13eab..192440491 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -145,6 +145,7 @@ void CExtendedInput::saveScreen() return; delete[] background; + background = NULL; background = new fb_pixel_t [width * height]; if(background)