diff --git a/gui/cfg_edit.pas b/gui/cfg_edit.pas index 368eb259..90b78175 100644 --- a/gui/cfg_edit.pas +++ b/gui/cfg_edit.pas @@ -217,6 +217,8 @@ begin if (src=nil) then Exit; i:=src.ItemIndex; + if (i=-1) then Exit; + ptr:=PVkPhysicalDeviceProperties(src.Items.Objects[i]); if (ptr=nil) then Exit; diff --git a/gui/game_run.pas b/gui/game_run.pas index 4b9a0b95..ca6a9377 100644 --- a/gui/game_run.pas +++ b/gui/game_run.pas @@ -121,7 +121,11 @@ end; Destructor TGameProcessSimple.Destroy; begin - thread_dec_ref(Ftd); + if (Ftd<>nil) then + begin + thread_dec_ref(Ftd); + Ftd:=nil; + end; inherited; end; diff --git a/sys/kern/kern_thread.pas b/sys/kern/kern_thread.pas index d718d4e3..973a4644 100644 --- a/sys/kern/kern_thread.pas +++ b/sys/kern/kern_thread.pas @@ -679,6 +679,7 @@ begin if (n<>0) then begin + Writeln(StdErr,'failed cpu_thread_create:0x',HexStr(n,8)); thread_free(newtd); Exit(EINVAL); end; diff --git a/sys/md/md_thread.pas b/sys/md/md_thread.pas index 7af2aae4..9a3f3392 100644 --- a/sys/md/md_thread.pas +++ b/sys/md/md_thread.pas @@ -325,7 +325,7 @@ begin Result:=0; end else begin - Result:=-1; + Result:=GetLastError; end; {$ENDIF}