DcmFileFormat *dfile = new DcmFileFormat();
OFCondition cond =dfile->loadFile(dlg.GetFileName(), EXS_Unknown,EGL_withoutGL,DCM_MaxReadLength,(const E_FileReadMode)OFFalse);
But I can't release variable 'dfile' by delete, such as
delete dfile;
dfile = NULL;
if I don't release 'dfile', there will be memory leak, anybody can help me?
how to release 'new DcmFileFormat'
Moderator: Moderator Team
-
- OFFIS DICOM Team
- Posts: 1493
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
Hi.
I am facing the same kind of problem when trying to build a multiframe dicom file.
1 - A DcmFileFormat object is created.
2 - A DcmPixelSequence object is created (with a DCM_PixelData tag).
3 - For each image, a DcmPixelItem object is created and inserted into the pixel sequence.
3 - A DcmPixeltem object is created to build an offset table ; that pixel item is inserted into the pixel sequence with prepend().
4 - The pixel sequence is inserted into the dataset of the DcmFileFormat object.
5 - The method save() of DcmFileFormat is called to create the file.
6 - "delete" is applied to the DcmFileFormat, the DcmPixelSequence and the set of DcmPixelItem.
Then the process crashes...
Is there anything wrong with that way? Thanks for any clue.
I am facing the same kind of problem when trying to build a multiframe dicom file.
1 - A DcmFileFormat object is created.
2 - A DcmPixelSequence object is created (with a DCM_PixelData tag).
3 - For each image, a DcmPixelItem object is created and inserted into the pixel sequence.
3 - A DcmPixeltem object is created to build an offset table ; that pixel item is inserted into the pixel sequence with prepend().
4 - The pixel sequence is inserted into the dataset of the DcmFileFormat object.
5 - The method save() of DcmFileFormat is called to create the file.
6 - "delete" is applied to the DcmFileFormat, the DcmPixelSequence and the set of DcmPixelItem.
Then the process crashes...
Is there anything wrong with that way? Thanks for any clue.
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
-
- OFFIS DICOM Team
- Posts: 1493
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
Who is online
Users browsing this forum: Bing [Bot] and 1 guest