moved Destroy() to the beginning
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6360 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -44,6 +44,7 @@ bool wxGIFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
|
|||||||
int error;
|
int error;
|
||||||
bool ok;
|
bool ok;
|
||||||
|
|
||||||
|
// image->Destroy();
|
||||||
decod = new wxGIFDecoder(&stream, TRUE);
|
decod = new wxGIFDecoder(&stream, TRUE);
|
||||||
error = decod->ReadGIF();
|
error = decod->ReadGIF();
|
||||||
|
|
||||||
@@ -70,14 +71,13 @@ bool wxGIFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
|
|||||||
|
|
||||||
if ((error == wxGIF_TRUNCATED) && verbose)
|
if ((error == wxGIF_TRUNCATED) && verbose)
|
||||||
{
|
{
|
||||||
wxLogWarning(_("wxGIFHandler: data stream seems to be truncated."));
|
wxLogError(_("wxGIFHandler: data stream seems to be truncated."));
|
||||||
/* go on; image data is OK */
|
/* go on; image data is OK */
|
||||||
}
|
}
|
||||||
|
|
||||||
image->Destroy();
|
|
||||||
ok = decod->ConvertToImage(image);
|
ok = decod->ConvertToImage(image);
|
||||||
|
|
||||||
delete decod;
|
delete decod;
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,8 +97,8 @@ bool wxGIFHandler::DoCanRead( wxInputStream& stream )
|
|||||||
|
|
||||||
decod = new wxGIFDecoder(&stream);
|
decod = new wxGIFDecoder(&stream);
|
||||||
ok = decod->CanRead();
|
ok = decod->CanRead();
|
||||||
|
|
||||||
delete decod;
|
delete decod;
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user