diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-10-01 22:19:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-10-02 23:19:51 +0100 |
commit | d820977d6aedc8447d50862751adb61cadf488c9 (patch) | |
tree | 03acb9b9145b57b5d42681200686fe5319511661 /hwpfilter/source | |
parent | callcatcher: various unused methods (diff) | |
download | core-d820977d6aedc8447d50862751adb61cadf488c9.tar.gz core-d820977d6aedc8447d50862751adb61cadf488c9.zip |
valgrind: fix leak
Diffstat (limited to 'hwpfilter/source')
-rw-r--r-- | hwpfilter/source/hwpfile.cxx | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx index b77cc1dad25f..66e0eb903ef5 100644 --- a/hwpfilter/source/hwpfile.cxx +++ b/hwpfilter/source/hwpfile.cxx @@ -70,16 +70,10 @@ HWPFile::HWPFile() SetCurrentDoc(this); } -/** - * TODO : Ãß°¡µÈ ½ºÅ¸Àϸ®½ºÆ®¿¡ ´ëÇÑ ¸Þ¸ð¸® ÇØÁ¦ - */ HWPFile::~HWPFile() { - if (oledata) - delete oledata; - - if (hiodev) - delete hiodev; + delete oledata; + delete hiodev; LinkedListIterator < ColumnInfo > it_column(&columnlist); for (; it_column.current(); it_column++) @@ -129,20 +123,17 @@ int detect_hwp_version(const char *str) int HWPFile::Open(HStream & stream) { - HStreamIODev *hstreamio; + HStreamIODev *hstreamio = new HStreamIODev(stream); - if (0 == (hstreamio = new HStreamIODev(stream))) - { - printf(" hstreamio is not instanciate \n"); - return SetState(errno); - } if (!hstreamio->open()) { delete hstreamio; return SetState(HWP_EMPTY_FILE); } - SetIODevice(hstreamio); + + HIODev *pPrev = SetIODevice(hstreamio); + delete pPrev; char idstr[HWPIDLen]; @@ -227,6 +218,7 @@ HIODev *HWPFile::SetIODevice(HIODev * new_hiodev) HIODev *old_hiodev = hiodev; hiodev = new_hiodev; + return old_hiodev; } |