Changeset 1012 for trunk/dll/dircnrs.c


Ignore:
Timestamp:
May 11, 2008, 10:27:56 PM (17 years ago)
Author:
Gregg Young
Message:

Fixed crash on directory container close with fortify enabled; fixed memory leak in assoc.c;added a fortify scope to correspond to the loading and unloading of fm3.dll

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/dircnrs.c

    r1011 r1012  
    6161#include "command.h"                    // RunCommand
    6262#include "fm3dll.h"
     63#include "fortify.h"
    6364
    6465#pragma data_seg(DATA1)
     
    33203321    if (dcd) {
    33213322      dcd->stopflag++;
     3323      //printf("%i %x %x %x\n", dcd->dontclose, dcd->hwndFrame, dcd->hwndObject, dcd);
    33223324      if (!dcd->dontclose && ParentIsDesktop(dcd->hwndFrame, (HWND) 0))
    33233325        PostMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID);
    3324       if (!dcd->hwndObject ||
    3325           !PostMsg(dcd->hwndObject, WM_CLOSE, MPVOID, MPVOID)) {
    3326         if (dcd->hwndObject)
    3327           WinSetWindowPtr(dcd->hwndObject, QWL_USER, NULL);
    3328         WinSetWindowPtr(hwnd, QWL_USER, NULL);
    3329         if (dcd->hwndRestore)
    3330           WinSetWindowPos(dcd->hwndRestore,
    3331                           HWND_TOP,
    3332                           0,
    3333                           0,
    3334                           0,
    3335                           0,
    3336                           SWP_RESTORE | SWP_SHOW | SWP_ACTIVATE | SWP_ZORDER);
    3337         FreeList(dcd->lastselection);
    3338         xfree(dcd, pszSrcFile, __LINE__);
    3339         DosPostEventSem(CompactSem);
    3340       }
     3326      if (dcd->hwndObject) {
     3327          WinSetWindowPtr(dcd->hwndObject, QWL_USER, NULL);
     3328          PostMsg(dcd->hwndObject, WM_CLOSE, MPVOID, MPVOID);
     3329      }
     3330      if (dcd->hwndRestore)
     3331        WinSetWindowPos(dcd->hwndRestore,
     3332                        HWND_TOP,
     3333                        0,
     3334                        0,
     3335                        0,
     3336                        0,
     3337                        SWP_RESTORE | SWP_SHOW | SWP_ACTIVATE | SWP_ZORDER);
     3338      //printf("%i %x %x %x\n", dcd->dontclose, dcd->hwndFrame, dcd->hwndObject, dcd);
     3339      FreeList(dcd->lastselection);
     3340      xfree(dcd, pszSrcFile, __LINE__);
     3341      WinSetWindowPtr(hwnd, QWL_USER, NULL);
     3342      //printf("%i %x %x %x\n", dcd->dontclose, dcd->hwndFrame, dcd->hwndObject, dcd);
     3343      //Fortify_LeaveScope();
     3344      DosPostEventSem(CompactSem);
    33413345    }
    33423346    WinDestroyWindow(WinQueryWindow(WinQueryWindow(hwnd, QW_PARENT),
     
    34173421        idinc = 0;
    34183422      WinSetWindowUShort(hwndFrame, QWS_ID, id);
     3423      //Fortify_EnterScope();
    34193424      dcd = xmallocz(sizeof(DIRCNRDATA), pszSrcFile, __LINE__);
    34203425      if (!dcd) {
    3421         PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID);
     3426        PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID);
    34223427        hwndFrame = (HWND) 0;
    34233428      }
     
    34673472                     IDS_WINCREATEWINDOW);
    34683473          PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID);
    3469           xfree(dcd, pszSrcFile, __LINE__);
     3474          xfree(dcd, pszSrcFile, __LINE__);
    34703475          hwndFrame = (HWND) 0;
    34713476        }
     
    34743479          WinSetWindowPtr(dcd->hwndCnr, QWL_USER, (PVOID) dcd);
    34753480          dcd->oldproc = WinSubclassWindow(dcd->hwndCnr,
    3476                                            (PFNWP) DirCnrWndProc);
     3481                                           (PFNWP) DirCnrWndProc);
    34773482          {
    34783483            USHORT ids[] = { DIR_TOTALS, DIR_SELECTED, DIR_VIEW, DIR_SORT,
Note: See TracChangeset for help on using the changeset viewer.