mirror of https://github.com/mpv-player/mpv
vo_x11: don't rely on XFree to free calloc-ed data
This commit is contained in:
parent
fa7503989f
commit
b616a6cef1
|
@ -153,9 +153,14 @@ static void freeMyXImage(struct priv *p, int foo)
|
|||
XDestroyImage(p->myximage[foo]);
|
||||
shmdt(p->Shminfo[foo].shmaddr);
|
||||
} else {
|
||||
if (p->myximage[foo])
|
||||
if (p->myximage[foo]) {
|
||||
// XDestroyImage() would free the data too since XFree() just calls
|
||||
// free(), but do it ourselves for portability reasons
|
||||
free(p->myximage[foo]->data);
|
||||
p->myximage[foo]->data = NULL;
|
||||
XDestroyImage(p->myximage[foo]);
|
||||
}
|
||||
}
|
||||
p->myximage[foo] = NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue