mirror of
https://github.com/sheumann/DiskBrowser.git
synced 2024-11-21 22:31:13 +00:00
Make sure we shut down the resource manager only for our user ID.
This fixes an issue that was causing crashes at shutdown in some cases.
This commit is contained in:
parent
a235d3b0e2
commit
009c1413aa
@ -28,6 +28,9 @@ GrafPortPtr window;
|
|||||||
/* Is the window open? */
|
/* Is the window open? */
|
||||||
Boolean windowOpened;
|
Boolean windowOpened;
|
||||||
|
|
||||||
|
/* Is the resource manager started for our user ID? */
|
||||||
|
Boolean resourceStarted = false;
|
||||||
|
|
||||||
/* Disks list control */
|
/* Disks list control */
|
||||||
CtlRecHndl disksListHandle;
|
CtlRecHndl disksListHandle;
|
||||||
|
|
||||||
@ -105,7 +108,13 @@ void DoGoAway(void) {
|
|||||||
CloseBrowserWindow();
|
CloseBrowserWindow();
|
||||||
RemoveMenuItem();
|
RemoveMenuItem();
|
||||||
AcceptRequests(NULL, myUserID, NULL);
|
AcceptRequests(NULL, myUserID, NULL);
|
||||||
ResourceShutDown();
|
if (resourceStarted) {
|
||||||
|
Word origResourceApp = GetCurResourceApp();
|
||||||
|
SetCurResourceApp(myUserID);
|
||||||
|
ResourceShutDown();
|
||||||
|
SetCurResourceApp(origResourceApp);
|
||||||
|
resourceStarted = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -171,6 +180,7 @@ int main(void) {
|
|||||||
|
|
||||||
Word origResourceApp = GetCurResourceApp();
|
Word origResourceApp = GetCurResourceApp();
|
||||||
ResourceStartUp(myUserID);
|
ResourceStartUp(myUserID);
|
||||||
|
resourceStarted = true;
|
||||||
SetCurResourceApp(origResourceApp);
|
SetCurResourceApp(origResourceApp);
|
||||||
|
|
||||||
/* Bail out if NetDisk or Marinetti is not present */
|
/* Bail out if NetDisk or Marinetti is not present */
|
||||||
|
Loading…
Reference in New Issue
Block a user