From 2988c8bcbbeeb370816d54edf10a4e2fe6687b81 Mon Sep 17 00:00:00 2001 From: "pnunn%netscape.com" Date: Wed, 9 Jun 1999 20:15:01 +0000 Subject: [PATCH] Clean up in IL_GetImage(). bugz#6045. pnunn. git-svn-id: svn://10.0.0.236/trunk@34466 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/modules/libimg/src/if.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/mozilla/modules/libimg/src/if.cpp b/mozilla/modules/libimg/src/if.cpp index 072be5a1a66..d272768a5bc 100644 --- a/mozilla/modules/libimg/src/if.cpp +++ b/mozilla/modules/libimg/src/if.cpp @@ -1944,9 +1944,12 @@ IL_GetImage(const char* image_url, break; default: - PR_ASSERT(0); - NS_RELEASE(image_req->net_cx); - PR_FREEIF(image_req); + PR_ASSERT(0); + /* NS_RELEASE(image_req->net_cx);*/ + /* PR_FREEIF(image_req);*/ + /* This takes the image_req out of the ic client list, + frees image_req->new_cx, frees image_req.*/ + int ret = il_delete_client(ic, image_req); return NULL; } @@ -1978,14 +1981,12 @@ IL_GetImage(const char* image_url, if (!url) { -#ifndef M12N /* XXXM12N fix me. */ - /* xxx clean up previously allocated objects */ - return MK_OUT_OF_MEMORY; -#else - NS_RELEASE(image_req->net_cx); - PR_FREEIF(image_req); + /* NS_RELEASE(image_req->net_cx);*/ + /* PR_FREEIF(image_req); */ + /* This takes the image_req out of the ic client list, + frees image_req->new_cx, frees image_req. */ + int ret = il_delete_client(ic, image_req); return NULL; -#endif /* M12N */ } #if 0 @@ -2001,9 +2002,12 @@ IL_GetImage(const char* image_url, /* save away the container */ reader = IL_NewNetReader(ic); if (!reader) { - NS_RELEASE(image_req->net_cx); - PR_FREEIF(image_req); - return NULL; + /* NS_RELEASE(image_req->net_cx); */ + /* PR_FREEIF(image_req);*/ + /* This takes the image_req out of the ic client list, + frees image_req->new_cx, frees image_req.*/ + int ret = il_delete_client(ic, image_req); + return NULL; } err = ic->net_cx->GetURL(url, cache_reload_policy, reader); /* Release reader, GetURL will keep a ref to it. */