Canvas: Set pointers to NULL instead of calling .release()

The Canvas camera and texture get recreated in several circumstances.
Calling .release() on a ref_ptr will just return the raw pointer and
'delete' won't be called. The proper way to explicitly delete an object
managed by a ref_ptr is to set the ref_ptr to NULL. This will delete it
as long as it's not referenced by any other ref_ptr.
This commit is contained in:
Fernando García Liñán 2021-08-31 18:04:50 +02:00 committed by Automatic Release Builder
parent 5fe527a2d1
commit 44bae773a0

View File

@ -298,8 +298,8 @@ namespace canvas
{
if( camera.valid() && Canvas::getSystemAdapter() )
Canvas::getSystemAdapter()->removeCamera(camera.get());
camera.release();
texture.release();
camera = nullptr;
texture = nullptr;
_flags &= ~AVAILABLE;
}