- Fixed: The SimpleCanvas in FCanvasTexture must be declared as a soft

root to the garbage collector.


SVN r798 (trunk)
This commit is contained in:
Christoph Oelckers 2008-03-12 17:47:22 +00:00
parent 07e795e656
commit b3635cfbd8
2 changed files with 5 additions and 1 deletions

View file

@ -1,4 +1,6 @@
March 12, 2008 (Changes by Graf Zahl) 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 - Changed DObject's pointer substitution so that the pointers inside an
object are handled by a virtual function. This allows subclasses to object are handled by a virtual function. This allows subclasses to
implement their own handling if they need it. implement their own handling if they need it.

View file

@ -105,6 +105,7 @@ void FCanvasTexture::MakeTexture ()
{ {
Canvas = new DSimpleCanvas (Width, Height); Canvas = new DSimpleCanvas (Width, Height);
Canvas->Lock (); Canvas->Lock ();
GC::AddSoftRoot(Canvas);
if (Width != Height || Width != Canvas->GetPitch()) if (Width != Height || Width != Canvas->GetPitch())
{ {
Pixels = new BYTE[Width*Height]; Pixels = new BYTE[Width*Height];
@ -127,7 +128,8 @@ void FCanvasTexture::Unload ()
delete[] Pixels; delete[] Pixels;
} }
Pixels = NULL; Pixels = NULL;
delete Canvas; GC::DelSoftRoot(Canvas);
Canvas->Destroy();
Canvas = NULL; Canvas = NULL;
} }
} }