Browse Source

palmos: bail out earlier when we're not in NormalLaunch mode, should fix Fatal Exception crash when installing the app on a real device using HotSync

git-svn-id: trunk@37931 -
Károly Balogh 7 năm trước cách đây
mục cha
commit
d03e0d3bfb
2 tập tin đã thay đổi với 12 bổ sung11 xóa
  1. 12 5
      rtl/palmos/si_prc.pp
  2. 0 6
      rtl/palmos/system.pp

+ 12 - 5
rtl/palmos/si_prc.pp

@@ -35,7 +35,6 @@ var
 procedure PascalMain; external name 'PASCALMAIN';
 procedure FPCRelocateData; forward;
 
-
 { this function must be the first in this unit which contains code }
 function _FPC_proc_start: longint; cdecl; public name '_start';
 var
@@ -43,6 +42,8 @@ var
   prevGlobals: Pointer;
   globalsPtr: Pointer;
 begin
+  _FPC_proc_start:=0;
+
   if SysAppStartup(locAppInfo, prevGlobals, globalsPtr) <> 0 then
     begin
       SndPlaySystemSound(sndError);
@@ -52,13 +53,19 @@ begin
   if (locAppInfo^.launchFlags and sysAppLaunchFlagNewGlobals) > 0 then
     FPCRelocateData;
 
-  if setjmp(sysinit_jmpbuf) = 0 then
+  { we don't support anything but normal startup now }
+  { FIXME: figure it out how various startup commands can }
+  { coexist with the normal system unit infrastructure (KB) }
+  if locAppInfo^.cmd = sysAppLaunchCmdNormalLaunch then
     begin
-      appInfo:=locAppInfo;
-      PascalMain;
+      if setjmp(sysinit_jmpbuf) = 0 then
+        begin
+          appInfo:=locAppInfo;
+          PascalMain;
+        end;
+      _FPC_proc_start:=ExitCode;
     end;
 
-  _FPC_proc_start:=ExitCode;
   SysAppExit(locAppInfo, prevGlobals, globalsPtr);
 end;
 

+ 0 - 6
rtl/palmos/system.pp

@@ -147,12 +147,6 @@ begin
 { Initialize ExitProc }
   ExitProc:=Nil;
 
-  { we don't support anything but normal startup now }
-  { FIXME: lets figure it out how various startup modes }
-  { can coexist with the system unit infrastructure (KB) }
-  if not (palmAppInfo^.cmd = sysAppLaunchCmdNormalLaunch) then
-    halt(0);
-
   SysInitExceptions;
 {$ifdef FPC_HAS_FEATURE_UNICODESTRINGS}
   InitUnicodeStringManager;