null check before deleting bitmap?

This commit is contained in:
Amy Bowersox 2019-12-11 14:21:27 -07:00
parent b90c2efe2f
commit 9318d27b2b

View File

@ -126,7 +126,8 @@ PyObject *Epython_wrap_bitmap(PBITMAP pbmp)
{ {
pbitmapobj = (BitmapObject *)rc; pbitmapobj = (BitmapObject *)rc;
Log(LDEBUG, "gonna delete bitmap"); Log(LDEBUG, "gonna delete bitmap");
BMP_Delete(pbitmapobj->pbmp); if (pbitmapobj->pbmp)
BMP_Delete(pbitmapobj->pbmp);
Log(LDEBUG, "deleted bitmap"); Log(LDEBUG, "deleted bitmap");
pbitmapobj->pbmp = pbmp; pbitmapobj->pbmp = pbmp;
} }