diff --git a/VocaluxeLib/Draw/CTextureRef.cs b/VocaluxeLib/Draw/CTextureRef.cs index d593cb12..1f13444d 100644 --- a/VocaluxeLib/Draw/CTextureRef.cs +++ b/VocaluxeLib/Draw/CTextureRef.cs @@ -68,8 +68,8 @@ namespace VocaluxeLib.Draw //Free textures that are no longer referenced CTextureRef tmp = this; CBase.Drawing.RemoveTexture(ref tmp); + _SetRemoved(); } - SetRemoved(); } /// @@ -80,6 +80,11 @@ namespace VocaluxeLib.Draw { if (ID < 0) throw new ObjectDisposedException(GetType().Name); + _SetRemoved(); + } + + private void _SetRemoved() + { ID = -1; GC.SuppressFinalize(this); }