From 8c096141902941022809025cb36db2c30f4dfc37 Mon Sep 17 00:00:00 2001 From: Wizzup? Date: Mon, 1 Feb 2010 08:21:52 +0000 Subject: [PATCH] Resolve 83 git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@505 3f818213-9676-44b0-a9b4-5e4c4e03d09d --- trunk/Units/MMLCore/client.pas | 2 ++ trunk/Units/MMLCore/iomanager.pas | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) 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;