The Image Manager 1024 no longer does a double free.

This commit is contained in:
OBattler
2021-12-29 18:45:07 +01:00
parent e129b054a6
commit 31067d63a0
3 changed files with 12 additions and 2 deletions

View File

@@ -133,6 +133,7 @@ extern void pgc_wake(pgc_t *);
extern void pgc_sleep(pgc_t *); extern void pgc_sleep(pgc_t *);
extern void pgc_setdisplay(pgc_t *, int cga); extern void pgc_setdisplay(pgc_t *, int cga);
extern void pgc_speed_changed(void *priv); extern void pgc_speed_changed(void *priv);
extern void pgc_close_common(void *priv);
extern void pgc_close(void *priv); extern void pgc_close(void *priv);
extern void pgc_init(pgc_t *, extern void pgc_init(pgc_t *,
int maxw, int maxh, int visw, int vish, int maxw, int maxh, int visw, int vish,

View File

@@ -1007,7 +1007,7 @@ im1024_close(void *priv)
{ {
im1024_t *dev = (im1024_t *)priv; im1024_t *dev = (im1024_t *)priv;
pgc_close(&dev->pgc); pgc_close_common(&dev->pgc);
free(dev); free(dev);
} }

View File

@@ -2600,7 +2600,7 @@ pgc_speed_changed(void *priv)
void void
pgc_close(void *priv) pgc_close_common(void *priv)
{ {
pgc_t *dev = (pgc_t *)priv; pgc_t *dev = (pgc_t *)priv;
@@ -2633,6 +2633,15 @@ pgc_close(void *priv)
free(dev->cga_vram); free(dev->cga_vram);
if (dev->vram) if (dev->vram)
free(dev->vram); free(dev->vram);
}
void
pgc_close(void *priv)
{
pgc_t *dev = (pgc_t *)priv;
pgc_close_common(priv);
free(dev); free(dev);
} }