Ignore:
Timestamp:
Feb 12, 2002, 2:10:14 PM (24 years ago)
Author:
sandervl
Message:

fixed reference count leak in SetFocus

File:
1 edited

Legend:

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

    r7875 r7887  
    1 /* $Id: window.cpp,v 1.118 2002-02-11 16:05:59 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.119 2002-02-12 13:10:14 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    732732 Win32BaseWindow *oldfocuswnd;
    733733 HWND lastFocus, lastFocus_W, hwnd_O, hwndTopParent;
    734  BOOL activate;
     734 BOOL activate, ret;
    735735 TEB *teb;
    736736
     
    770770    if(HOOK_CallHooksA(WH_CBT, HCBT_SETFOCUS, hwnd, (LPARAM)lastFocus_W)) {
    771771        dprintf(("hook cancelled SetFocus call!"));
     772        RELEASE_WNDOBJ(window);
    772773        return 0;
    773774    }
     
    781782        //mp2 = top parent if activation required
    782783        OSLibPostMessageDirect(hwnd_O, WIN32APP_SETFOCUSMSG, hwnd, (activate) ? hwndTopParent : 0);
     784        RELEASE_WNDOBJ(window);
    783785        return lastFocus_W;
    784786    }
     
    787789
    788790    //NOTE: Don't always activate the window or else the z-order will be changed!!
    789     return (OSLibWinSetFocus(OSLIB_HWND_DESKTOP, hwnd_O, activate)) ? lastFocus_W : 0;
     791    ret = (OSLibWinSetFocus(OSLIB_HWND_DESKTOP, hwnd_O, activate)) ? lastFocus_W : 0;
     792    RELEASE_WNDOBJ(window);
     793    return ret;
    790794}
    791795//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.