Ignore:
Timestamp:
Jun 10, 2001, 11:19:58 AM (24 years ago)
Author:
sandervl
Message:

bugfixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/win32wbase.cpp

    r5935 r5950  
    1 /* $Id: win32wbase.cpp,v 1.260 2001-06-09 14:50:21 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.261 2001-06-10 09:19:58 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    241241        RELEASE_WNDOBJ(wndparent);
    242242    }
     243    if(owner) {
     244        RELEASE_WNDOBJ(owner);
     245    }
    243246    if(windowClass) {
    244247        RELEASE_CLASSOBJ(windowClass);
     
    10551058
    10561059                    //SvL: Calling OSLibSetActiveWindow(hwndTop); causes focus problems
    1057                     if (win32top) OSLibWinSetFocus(win32top->getOS2FrameWindowHandle());
     1060                    if (win32top) {
     1061                        OSLibWinSetFocus(win32top->getOS2FrameWindowHandle());
     1062                        RELEASE_WNDOBJ(win32top);
     1063                    }
    10581064                }
    10591065        }
     
    17211727                siblingWindow->SendInternalMessageA (BM_CLICK, 0, 0);
    17221728            }
    1723 
    17241729            sibling = siblingWindow->GetNextWindow (GW_HWNDNEXT);
     1730            RELEASE_WNDOBJ(siblingWindow);
    17251731        }
    17261732
     
    21132119                else    PostMessageA(window->getWindowHandle(), msg, wParam, lParam);
    21142120            }
     2121            RELEASE_WNDOBJ(window);
    21152122        }
    21162123    }
     
    21372144                else    PostMessageW(window->getWindowHandle(), msg, wParam, lParam);
    21382145            }
     2146            RELEASE_WNDOBJ(window);
    21392147        }
    21402148    }
     
    24572465        if(wndBehind) {
    24582466            swp.hwndInsertBehind   = wndBehind->getOS2FrameWindowHandle();
     2467            RELEASE_WNDOBJ(wndBehind);
    24592468        }
    24602469        else {
     
    27362745        fShow = TRUE;
    27372746   }
    2738 
     2747   if(oldparent) {
     2748        RELEASE_WNDOBJ(oldparent);
     2749   }
    27392750   newparent = GetWindowFromHandle(hwndNewParent);
    27402751   if(newparent && !newparent->isDesktopWindow())
     
    29502961 Win32BaseWindow *parent = GetWindowFromHandle(hwndParent);
    29512962 Win32BaseWindow *child  = GetWindowFromHandle(hwndChildAfter);
     2963 Win32BaseWindow *firstchild = child;
    29522964
    29532965    dprintf(("FindWindowEx %x %x %x %s", hwndParent, hwndChildAfter, atom, lpszWindow));
     
    29562968       (hwndParent == 0 && hwndChildAfter != 0))
    29572969    {
     2970        if(parent)      RELEASE_WNDOBJ(parent);
     2971        if(firstchild)  RELEASE_WNDOBJ(firstchild);
    29582972        dprintf(("Win32BaseWindow::FindWindowEx: parent or child not found %x %x", hwndParent, hwndChildAfter));
    29592973        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     
    29632977    if(hwndParent != 0)
    29642978    {//if the current process owns the window, just do a quick search
     2979        lock(&critsect);
    29652980        child = (Win32BaseWindow *)parent->getFirstChild();
    29662981        if(hwndChildAfter != 0)
     
    29832998            {
    29842999                dprintf(("FindWindowEx: Found window %x", child->getWindowHandle()));
    2985                 return child->getWindowHandle();
     3000                HWND hwndChild = child->getWindowHandle();
     3001                unlock(&critsect);
     3002                if(parent)      RELEASE_WNDOBJ(parent);
     3003                if(firstchild)  RELEASE_WNDOBJ(firstchild);
     3004                dprintf(("FindWindowEx: Found window %x", child->getWindowHandle()));
     3005                return hwndChild;
    29863006            }
    29873007            child = (Win32BaseWindow *)child->getNextChild();
    29883008        }
     3009        unlock(&critsect);
     3010        if(parent)      RELEASE_WNDOBJ(parent);
     3011        if(firstchild)  RELEASE_WNDOBJ(firstchild);
    29893012    }
    29903013    else {
     
    30193042        }
    30203043        OSLibWinEndEnumWindows(henum);
     3044        if(parent)      RELEASE_WNDOBJ(parent);
     3045        if(firstchild)  RELEASE_WNDOBJ(firstchild);
    30213046    }
    30223047    SetLastError(ERROR_CANNOT_FIND_WND_CLASS); //TODO: not always correct
     
    35323557HWND Win32BaseWindow::getNextDlgGroupItem(HWND hwndCtrl, BOOL fPrevious)
    35333558{
    3534  Win32BaseWindow *child, *nextchild, *lastchild;
     3559 Win32BaseWindow *firstchild = NULL, *child, *nextchild, *lastchild;
    35353560 HWND retvalue;
    35363561
     3562    lock();
    35373563    if (hwndCtrl)
    35383564    {
    3539         child = GetWindowFromHandle(hwndCtrl);
     3565        firstchild = child = GetWindowFromHandle(hwndCtrl);
    35403566        if (!child)
    35413567        {
     
    35493575            if(child == NULL) break;
    35503576        }
    3551 
    35523577        if (!child || (child->getParent() != this))
    35533578        {
     
    36113636    retvalue = lastchild->getWindowHandle();
    36123637END:
     3638    unlock();
     3639    if(firstchild) RELEASE_WNDOBJ(firstchild);
    36133640    return retvalue;
    36143641}
     
    36243651    if(HwGetWindowHandleData(hwnd, (DWORD *)&window) == TRUE) {
    36253652         if(window) {
    3626 ////             dprintf(("addRef %x; refcount %d", hwnd, window->getRefCount()+1));
     3653             dprintf(("addRef %x; refcount %d", hwnd, window->getRefCount()+1));
    36273654             window->addRef();
    36283655         }
Note: See TracChangeset for help on using the changeset viewer.