diff --git a/trunk/Units/MMLCore/client.pas b/trunk/Units/MMLCore/client.pas index 4da6aaa..000bb8f 100644 --- a/trunk/Units/MMLCore/client.pas +++ b/trunk/Units/MMLCore/client.pas @@ -71,6 +71,8 @@ end; destructor TClient.Destroy; begin + IOManager.SetState(True); + MOCR.Free; MDTM.Free; MBitmaps.Free; diff --git a/trunk/Units/MMLCore/iomanager.pas b/trunk/Units/MMLCore/iomanager.pas index cb89e01..a2061ea 100644 --- a/trunk/Units/MMLCore/iomanager.pas +++ b/trunk/Units/MMLCore/iomanager.pas @@ -261,6 +261,7 @@ interface procedure SetImageTarget(idx: integer); procedure SetKeyMouseTarget(idx: integer); procedure FreeTarget(idx: integer); + procedure SetState(val: Boolean); protected function SetImageTarget(target: TTarget): integer; @@ -275,11 +276,13 @@ interface frozen: TTarget; freezebuffer: prgb32; bothsame: boolean; + FStopping: Boolean; idxarr: array of TTarget; function GetTargetIdx(target: TTarget): integer; function GetIdxTarget(idx: integer): TTarget; + property Stopping: Boolean Read FStopping write SetState; end; implementation @@ -446,7 +449,7 @@ end; procedure TIOManager_Abstract.BitmapDestroyed(Bitmap : TMufasaBitmap); begin if image is TBitmapTarget then - if TBitmapTarget(image).bitmap = Bitmap then + if (TBitmapTarget(image).bitmap = Bitmap) and (not FStopping) then raise Exception.Create('Target bitmap was destroyed!'); end; @@ -554,6 +557,12 @@ begin result := keymouse.GetKeyCode(c); end; +// TRUE when STOPPING. +procedure TIOManager_Abstract.SetState(val: Boolean); +begin + FStopping := val; +end; + //***implementation*** TTarget procedure TTarget.GetTargetDimensions(var w, h: integer); begin raise Exception.Create('GetTargetDimensions not available for this target'); end;