Nikolay Sivov : shell32/shellview: Remove unneeded memset, release browser reference on failure.

Alexandre Julliard julliard at winehq.org
Mon Mar 15 12:19:36 CDT 2010


Module: wine
Branch: master
Commit: 4261aaffd7861821192c6dcbb44882e63dc0e7e9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4261aaffd7861821192c6dcbb44882e63dc0e7e9

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sat Mar  6 23:53:38 2010 +0300

shell32/shellview: Remove unneeded memset, release browser reference on failure.

---

 dlls/shell32/shlview.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c
index 2b1ac1f..c2fb973 100644
--- a/dlls/shell32/shlview.c
+++ b/dlls/shell32/shlview.c
@@ -2068,7 +2068,7 @@ static HRESULT WINAPI IShellView2_fnCreateViewWindow2(IShellView2* iface, LPSV2C
 
     /* Get our parent window */
     IShellBrowser_AddRef(This->pShellBrowser);
-    IShellBrowser_GetWindow(This->pShellBrowser, &(This->hWndParent));
+    IShellBrowser_GetWindow(This->pShellBrowser, &This->hWndParent);
 
     /* Try to get the ICommDlgBrowserInterface, adds a reference !!! */
     This->pCommDlgBrowser = NULL;
@@ -2079,7 +2079,6 @@ static HRESULT WINAPI IShellView2_fnCreateViewWindow2(IShellView2* iface, LPSV2C
     /* If our window class has not been registered, then do so */
     if (!GetClassInfoW(shell32_hInstance, SV_CLASS_NAME, &wc))
     {
-        ZeroMemory(&wc, sizeof(wc));
         wc.style            = CS_HREDRAW | CS_VREDRAW;
         wc.lpfnWndProc      = ShellView_WndProc;
         wc.cbClsExtra       = 0;
@@ -2102,7 +2101,11 @@ static HRESULT WINAPI IShellView2_fnCreateViewWindow2(IShellView2* iface, LPSV2C
 
     CheckToolbar(This);
 
-    if (!wnd) return E_FAIL;
+    if (!wnd)
+    {
+        IShellBrowser_Release(This->pShellBrowser);
+        return E_FAIL;
+    }
 
     SetWindowPos(wnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
     UpdateWindow(wnd);




More information about the wine-cvs mailing list