Browse Source

HPCC-13486 Fix memory leaks in wuwebview

The existing code does not release exceptions after catching
them. The code is added to fix the memory leaks.

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
wangkx 10 years ago
parent
commit
504f926761
1 changed files with 19 additions and 0 deletions
  1. 19 0
      common/wuwebview/wuwebview.cpp

+ 19 - 0
common/wuwebview/wuwebview.cpp

@@ -759,6 +759,12 @@ ILoadedDllEntry *WuWebView::loadDll(bool force)
         {
             dll.setown(queryDllServer().loadDll(dllname.str(), DllLocationAnywhere));
         }
+        catch (IException *e)
+        {
+            VStringBuffer msg("Failed to load %s", dllname.str());
+            EXCLOG(e, msg.str());
+            e->Release();
+        }
         catch(...)
         {
             DBGLOG("Failed to load %s", dllname.str());
@@ -896,6 +902,13 @@ extern WUWEBVIEW_API IWuWebView *createWuWebView(IConstWorkUnit &wu, const char
     {
         return new WuWebView(wu, target, queryname, dir, mapEspDirectories);
     }
+    catch (IException *e)
+    {
+        SCMStringBuffer wuid;
+        VStringBuffer msg("ERROR loading workunit %s shared object.", wu.getWuid(wuid).str());
+        EXCLOG(e, msg.str());
+        e->Release();
+    }
     catch (...)
     {
         SCMStringBuffer wuid;
@@ -910,6 +923,12 @@ extern WUWEBVIEW_API IWuWebView *createWuWebView(const char *wuid, const char *t
     {
         return new WuWebView(wuid, target, queryname, dir, mapEspDirectories);
     }
+    catch (IException *e)
+    {
+        VStringBuffer msg("ERROR loading workunit %s shared object.", wuid);
+        EXCLOG(e, msg.str());
+        e->Release();
+    }
     catch (...)
     {
         DBGLOG("ERROR loading workunit %s shared object.", wuid);