Ignore:
Timestamp:
Dec 29, 1999, 3:37:19 PM (26 years ago)
Author:
sandervl
Message:

PostMessage memory leak fixed

File:
1 edited

Legend:

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

    r2246 r2250  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.4 1999-12-29 12:39:44 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.5 1999-12-29 14:37:16 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    102102//******************************************************************************
    103103//******************************************************************************
    104 BOOL OS2ToWinMsgTranslate(void *pThdb, QMSG *os2Msg, MSG *winMsg, BOOL isUnicode, BOOL fTranslateExtraMsgs)
     104BOOL OS2ToWinMsgTranslate(void *pThdb, QMSG *os2Msg, MSG *winMsg, BOOL isUnicode, BOOL fMsgRemoved)
    105105{
    106106  Win32BaseWindow *win32wnd = 0;
     
    128128    {
    129129        packet = (POSTMSG_PACKET *)os2Msg->mp2;
    130         if(packet && (ULONG)os2Msg->mp1 == WIN32PM_MAGIC) {
     130        if(packet && ((ULONG)os2Msg->mp1 == WIN32MSG_MAGICA || (ULONG)os2Msg->mp1 == WIN32MSG_MAGICW)) {
    131131            winMsg->message = packet->Msg;
    132132            winMsg->wParam  = packet->wParam;
    133133            winMsg->lParam  = packet->lParam;
    134             if(win32wnd == NULL) {
    135                 free(packet); //messages posted by PostThreadMessage are never dispatched, so free the memory here
    136             }
     134            if(fMsgRemoved == MSG_REMOVE) free(packet); //free the shared memory here
    137135            break;
    138136        }
Note: See TracChangeset for help on using the changeset viewer.