(really cyeh) fix crashing bug in optimized builds of viewer, but i'm really suprised that this didn't crash more often.

This commit is contained in:
cyeh%netscape.com 1999-03-02 00:03:30 +00:00
parent 2e7efae0cd
commit cb747fecb4
2 changed files with 8 additions and 0 deletions

View File

@ -1473,6 +1473,7 @@ nsresult nsRepository::AutoRegister(NSRegistrationInstant when,
ProcessSerialNumber psn;
ProcessInfoRec pInfo;
FSSpec appFSSpec;
FSSpec tempSpec;
long theDirID;
Str255 name;
#endif
@ -1486,6 +1487,9 @@ nsresult nsRepository::AutoRegister(NSRegistrationInstant when,
// get info for the the current process to determine the directory its located in
if (!(err = GetCurrentProcess(&psn)))
{
// initialize ProcessInfoRec before calling GetProcessInformation() or die horribly.
pInfo.processName = nil;
pInfo.processAppSpec = &tempSpec;
if (!(err = GetProcessInformation(&psn, &pInfo)))
{
appFSSpec = *(pInfo.processAppSpec);

View File

@ -1473,6 +1473,7 @@ nsresult nsRepository::AutoRegister(NSRegistrationInstant when,
ProcessSerialNumber psn;
ProcessInfoRec pInfo;
FSSpec appFSSpec;
FSSpec tempSpec;
long theDirID;
Str255 name;
#endif
@ -1486,6 +1487,9 @@ nsresult nsRepository::AutoRegister(NSRegistrationInstant when,
// get info for the the current process to determine the directory its located in
if (!(err = GetCurrentProcess(&psn)))
{
// initialize ProcessInfoRec before calling GetProcessInformation() or die horribly.
pInfo.processName = nil;
pInfo.processAppSpec = &tempSpec;
if (!(err = GetProcessInformation(&psn, &pInfo)))
{
appFSSpec = *(pInfo.processAppSpec);