]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imaggif.cpp
some != NULL checks
[wxWidgets.git] / src / common / imaggif.cpp
index 74e573df34173d361ac0f14d8891f24e64064aa2..717e9673901ab0dbfbb0d0582c8078c79430e636 100644 (file)
@@ -44,6 +44,7 @@ bool wxGIFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose
     int error;
     bool ok;
 
+//    image->Destroy();
     decod = new wxGIFDecoder(&stream, TRUE);
     error = decod->ReadGIF();
 
@@ -70,14 +71,13 @@ bool wxGIFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool 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 */
     }
 
-    image->Destroy();
     ok = decod->ConvertToImage(image);
-
     delete decod;
+
     return ok;
 }
 
@@ -97,8 +97,8 @@ bool wxGIFHandler::DoCanRead( wxInputStream& stream )
 
     decod = new wxGIFDecoder(&stream);
     ok = decod->CanRead();
-
     delete decod;
+
     return ok;
 }