-rw-r--r-- | microkde/kstaticdeleter.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/microkde/kstaticdeleter.h b/microkde/kstaticdeleter.h index dfd3929..d9c2b72 100644 --- a/microkde/kstaticdeleter.h +++ b/microkde/kstaticdeleter.h @@ -29,8 +29,9 @@ class KStaticDeleter public: KStaticDeleter() {}; - type *setObject( type *obj, bool isArray = false) { _mobj = obj;return obj; } - virtual ~KStaticDeleter() {delete _mobj;}; + type *setObject( type *obj, bool isArray = false) { _mobj = obj;_isArray = isArray;return obj; } + virtual ~KStaticDeleter() {if (_isArray) delete[] _mobj; else delete _mobj;}; private: type* _mobj; + bool _isArray; }; |