because never used... and in the same time, that's remove some memory leaks
-- BeNours
+2004-11-15 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+ * src/gdcmDocument.[cxx|h] : fix memory leaks. The return is suppressed
+ because never used... and in the same time, that's remove some memory leaks
+
2004-11-15 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
* src/gdcmFile.cxx : now delete the PixelConvert instance.
* In examples and tests : change the type of image data variables from void*
2004-11-15 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
* src/gdcmFile.cxx : now delete the PixelConvert instance.
* In examples and tests : change the type of image data variables from void*
Program: gdcm
Module: $RCSfile: gdcmBinEntry.cxx,v $
Language: C++
Program: gdcm
Module: $RCSfile: gdcmBinEntry.cxx,v $
Language: C++
- Date: $Date: 2004/11/03 20:52:12 $
- Version: $Revision: 1.35 $
+ Date: $Date: 2004/11/15 16:12:30 $
+ Version: $Revision: 1.36 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
if (BinArea)
delete[] BinArea;
{
if (BinArea)
delete[] BinArea;
}
//-----------------------------------------------------------------------------
}
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/11/12 21:33:46 $
- Version: $Revision: 1.122 $
+ Date: $Date: 2004/11/15 16:12:30 $
+ Version: $Revision: 1.123 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param group group number of the Entry
* @param elem element number of the Entry
*/
* @param group group number of the Entry
* @param elem element number of the Entry
*/
-void* Document::LoadEntryBinArea(uint16_t group, uint16_t elem)
+void Document::LoadEntryBinArea(uint16_t group, uint16_t elem)
+ // Search the corresponding DocEntry
DocEntry *docElement = GetDocEntryByNumber(group, elem);
if ( !docElement )
DocEntry *docElement = GetDocEntryByNumber(group, elem);
if ( !docElement )
size_t o =(size_t)docElement->GetOffset();
Fp->seekg( o, std::ios_base::beg);
size_t l = docElement->GetLength();
size_t o =(size_t)docElement->GetOffset();
Fp->seekg( o, std::ios_base::beg);
size_t l = docElement->GetLength();
if(!a)
{
dbg.Verbose(0, "Document::LoadEntryBinArea cannot allocate a");
if(!a)
{
dbg.Verbose(0, "Document::LoadEntryBinArea cannot allocate a");
Fp->read((char*)a, l);
if( Fp->fail() || Fp->eof() )//Fp->gcount() == 1
{
delete[] a;
Fp->read((char*)a, l);
if( Fp->fail() || Fp->eof() )//Fp->gcount() == 1
{
delete[] a;
- /// \todo Drop any already existing void area! JPR
+
+ // Set the value to the DocEntry
if( !SetEntryBinAreaByNumber( a, group, elem ) )
{
if( !SetEntryBinAreaByNumber( a, group, elem ) )
{
dbg.Verbose(0, "Document::LoadEntryBinArea setting failed.");
}
dbg.Verbose(0, "Document::LoadEntryBinArea setting failed.");
}
}
/**
* \brief Loads (from disk) the element content
* when a string is not suitable
* @param element Entry whose binArea is going to be loaded
*/
}
/**
* \brief Loads (from disk) the element content
* when a string is not suitable
* @param element Entry whose binArea is going to be loaded
*/
-void* Document::LoadEntryBinArea(BinEntry* element)
+void Document::LoadEntryBinArea(BinEntry* element)
{
size_t o =(size_t)element->GetOffset();
Fp->seekg(o, std::ios_base::beg);
{
size_t o =(size_t)element->GetOffset();
Fp->seekg(o, std::ios_base::beg);
if( !a )
{
dbg.Verbose(0, "Document::LoadEntryBinArea cannot allocate a");
if( !a )
{
dbg.Verbose(0, "Document::LoadEntryBinArea cannot allocate a");
- element->SetBinArea((uint8_t*)a);
/// \todo check the result
Fp->read((char*)a, l);
if( Fp->fail() || Fp->eof()) //Fp->gcount() == 1
{
delete[] a;
/// \todo check the result
Fp->read((char*)a, l);
if( Fp->fail() || Fp->eof()) //Fp->gcount() == 1
{
delete[] a;
+ element->SetBinArea((uint8_t*)a);
if ( BinEntry* binEntry = dynamic_cast<BinEntry*>(currentEntry) )
{
binEntry->SetBinArea( area );
return true;
}
if ( BinEntry* binEntry = dynamic_cast<BinEntry*>(currentEntry) )
{
binEntry->SetBinArea( area );
return true;
}
Program: gdcm
Module: $RCSfile: gdcmDocument.h,v $
Language: C++
Program: gdcm
Module: $RCSfile: gdcmDocument.h,v $
Language: C++
- Date: $Date: 2004/11/12 21:33:46 $
- Version: $Revision: 1.57 $
+ Date: $Date: 2004/11/15 16:12:30 $
+ Version: $Revision: 1.58 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
bool ReplaceIfExistByNumber ( std::string const & value,
uint16_t group, uint16_t elem );
bool ReplaceIfExistByNumber ( std::string const & value,
uint16_t group, uint16_t elem );
- virtual void* LoadEntryBinArea(uint16_t group, uint16_t elem);
- virtual void* LoadEntryBinArea(BinEntry* entry);
+ virtual void LoadEntryBinArea(uint16_t group, uint16_t elem);
+ virtual void LoadEntryBinArea(BinEntry* entry);
// System access (meaning endian related !?)
uint16_t SwapShort(uint16_t); // needed by File
// System access (meaning endian related !?)
uint16_t SwapShort(uint16_t); // needed by File