aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/lib
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-05-08 18:31:08 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-05-08 18:31:08 +0000
commit2a708a74d0a2e9a26caeb6bacf9f252102c89326 (patch)
treeef5ae378fdf4430297e25f052f29fc862f02b9e0 /Game/Code/lib
parent9aa48684216b0dca926fa7e68a1b843dc1a872ce (diff)
downloadusdx-2a708a74d0a2e9a26caeb6bacf9f252102c89326.tar.gz
usdx-2a708a74d0a2e9a26caeb6bacf9f252102c89326.tar.xz
usdx-2a708a74d0a2e9a26caeb6bacf9f252102c89326.zip
added "inherited ..." to all constructors to assure that the base-class constructor is called.
Different to C or Java, the constructor or destructor of the base class (except that of TObject) is not called by default if "inherited ..." is not given (very strange). This is no problem with classes inherited directly from TObject, because the TObject constructor is always called (and sets the values of the fields to 0-values) but i added inherited to these constructors too because the base class may change from TObject to something different and the "inherited" will probably not added in this case and causing problems. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1070 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/lib/projectM/projectM-0_9.inc3
-rw-r--r--Game/Code/lib/projectM/projectM-1_0.inc3
2 files changed, 6 insertions, 0 deletions
diff --git a/Game/Code/lib/projectM/projectM-0_9.inc b/Game/Code/lib/projectM/projectM-0_9.inc
index 24d83700..4aed3260 100644
--- a/Game/Code/lib/projectM/projectM-0_9.inc
+++ b/Game/Code/lib/projectM/projectM-0_9.inc
@@ -321,6 +321,8 @@ constructor TProjectM.Create(gx, gy: integer; fps: integer;
var
state: PProjectMState;
begin
+ inherited Create();
+
New(state);
data := state;
@@ -420,5 +422,6 @@ destructor TProjectM.Destroy();
begin
Dispose(PProjectMState(data));
data := nil;
+ inherited;
end;
diff --git a/Game/Code/lib/projectM/projectM-1_0.inc b/Game/Code/lib/projectM/projectM-1_0.inc
index a1c1c1f4..96b224ae 100644
--- a/Game/Code/lib/projectM/projectM-1_0.inc
+++ b/Game/Code/lib/projectM/projectM-1_0.inc
@@ -68,6 +68,8 @@ end;
constructor TProjectM.Create(const configFile: string);
begin
+ inherited Create();
+
// we cannot catch C++ exceptions in delphi, so we have to check
// if configFile is valid first
if (FileExists(configFile)) then
@@ -166,5 +168,6 @@ destructor TProjectM.Destroy();
begin
_projectM_free(data);
data := nil;
+ inherited;
end;