From b3635cfbd8b2783551e237e2c3a7bdc12c5049ee Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 12 Mar 2008 17:47:22 +0000 Subject: [PATCH] - Fixed: The SimpleCanvas in FCanvasTexture must be declared as a soft root to the garbage collector. SVN r798 (trunk) --- docs/rh-log.txt | 2 ++ src/textures/canvastexture.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index aea95c4f4..942dd2aeb 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,6 @@ March 12, 2008 (Changes by Graf Zahl) +- Fixed: The SimpleCanvas in FCanvasTexture must be declared as a soft + root to the garbage collector. - Changed DObject's pointer substitution so that the pointers inside an object are handled by a virtual function. This allows subclasses to implement their own handling if they need it. diff --git a/src/textures/canvastexture.cpp b/src/textures/canvastexture.cpp index 988610e6e..53a62810c 100644 --- a/src/textures/canvastexture.cpp +++ b/src/textures/canvastexture.cpp @@ -105,6 +105,7 @@ void FCanvasTexture::MakeTexture () { Canvas = new DSimpleCanvas (Width, Height); Canvas->Lock (); + GC::AddSoftRoot(Canvas); if (Width != Height || Width != Canvas->GetPitch()) { Pixels = new BYTE[Width*Height]; @@ -127,7 +128,8 @@ void FCanvasTexture::Unload () delete[] Pixels; } Pixels = NULL; - delete Canvas; + GC::DelSoftRoot(Canvas); + Canvas->Destroy(); Canvas = NULL; } }