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; } }