summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2008-09-18 13:07:58 +0200
committerDanny Baumann <dannybaumann@web.de>2008-09-18 13:07:58 +0200
commit09ab35f0c5485806e4fdd47ca588b933d8db0ae1 (patch)
tree8d003b8ef080660cd210a10a070ffc3416ecc9c1
parente59288808477e2681a787bbefe4880895a03c290 (diff)
downloadsimple-ccsm-kde-09ab35f0c5485806e4fdd47ca588b933d8db0ae1.tar.gz
simple-ccsm-kde-09ab35f0c5485806e4fdd47ca588b933d8db0ae1.tar.bz2
Fixed a few memleaks.
-rw-r--r--dialog.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/dialog.cpp b/dialog.cpp
index 5880520..b50c910 100644
--- a/dialog.cpp
+++ b/dialog.cpp
@@ -483,13 +483,16 @@ void Dialog::saveCombo( CCSPlugin* p, const char* option, QComboBox* combo )
CCSSettingValueList l;
int val[ 1 ] = { combo->itemData( combo->currentIndex()).toInt() };
l = ccsGetValueListFromIntArray( val, 1, s );
- ccsSetList( s, l );
+ if (l)
+ {
+ ccsSetList( s, l );
+ ccsSettingValueListFree( l, TRUE );
+ }
}
else if( s->type == TypeInt )
ccsSetInt( s, combo->itemData( combo->currentIndex()).toInt());
else
abort();
- // leaks?
}
void Dialog::setupSpinbox( CCSPlugin* p, const char* option, QLabel* label, QDoubleSpinBox* spinbox )
@@ -705,10 +708,15 @@ int Dialog::listIntOption( CCSSetting* s )
{
CCSSettingValueList l;
ccsGetList( s, &l );
- int num;
+ int num, retval = 0;
int* val = ccsGetIntArrayFromValueList( l, &num );
- return num >= 1 ? val[ 0 ] : 0;
- // leaks? who knows ...
+ if ( l != NULL)
+ {
+ if (num >= 1)
+ retval = val[ 0 ];
+ free( val );
+ }
+ return retval;
}
Widget::Widget( QWidget* parent )