Skip to content
Snippets Groups Projects
Commit 60b5b2e4 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix memory leak in initializing vmem.

Much easier to fix it this way than to figure out why X11 needs to
init it before bitmap_con does.
parent 2ea1515f
No related branches found
No related tags found
No related merge requests found
Pipeline #6752 passed
......@@ -1935,7 +1935,6 @@ int bitmap_drv_init(void (*drawrect_cb) (struct rectlist *data)
pthread_mutex_init(&screenlock, NULL);
pthread_mutex_init(&free_rect_lock, NULL);
pthread_mutex_lock(&vstatlock);
vstat.vmem=NULL;
vstat.flags = VIDMODES_FLAG_PALETTE_VMEM;
pthread_mutex_lock(&screenlock);
for (i = 0; i < sizeof(dac_default)/sizeof(struct dac_colors); i++) {
......
......@@ -305,7 +305,8 @@ void release_vmem(struct vstat_vmem *vm)
{
if (vm == NULL)
return;
vm->refcount--;
if (vm->refcount)
vm->refcount--;
if (vm->refcount == 0) {
FREE_AND_NULL(vm->vmem);
FREE_AND_NULL(vm);
......
......@@ -12,6 +12,7 @@ Fix focus-follows-mouse behaviour in herbstluftwm
Fix SAUCE binary capture date
Add Build Options menu item
Fix saving non-integer scaling in GDI mode
Fix static 20k memory leak
Version 1.2rc1
--------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment