Skip to content

Commit 415f2c0

Browse files
committed
Point the image to null to prevent it from being deleted when the wrapper gets deleted.
1 parent 4196674 commit 415f2c0

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

source/core/support/imageutil.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,14 +1387,11 @@ ImageData *Copy_Image(ImageData *Old)
13871387

13881388
void Destroy_Image(ImageData *image)
13891389
{
1390-
return;
1391-
1392-
// Images are now cached
1393-
1394-
// if ((image == nullptr) || (--(image->References) > 0))
1395-
// return;
1396-
//
1397-
// delete image;
1390+
if ((image == nullptr) || (--(image->References) > 0))
1391+
return;
1392+
1393+
image->data = nullptr; // Prevent the image from being deleted. Images are now cached.
1394+
delete image;
13981395
}
13991396

14001397
void Remove_Cached_Image(Image* image) {

0 commit comments

Comments
 (0)