diff options
-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; } |