Skip to content

Commit

Permalink
fix memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
LBCrion committed Nov 7, 2024
1 parent 9c9b61f commit acd84a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/gui/pageritem.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,14 @@ static gboolean pager_item_draw_preview ( GtkWidget *widget, cairo_t *cr,

for(i=0;i<n;i++)
{
if(i==focus)
cairo_set_source_rgba(cr,fg.red,fg.blue,fg.green,1);
else
cairo_set_source_rgba(cr,fg.red,fg.blue,fg.green,0.5);
cairo_set_source_rgba(cr, fg.red, fg.blue, fg.green, (i==focus)?1:0.5);
cairo_rectangle(cr,
(int)(wins[i].x*w/spc.width),
(int)(wins[i].y*h/spc.height),
(int)(wins[i].width*w/spc.width),
(int)(wins[i].height*h/spc.height));
cairo_fill(cr);
gtk_render_frame(style,cr,
gtk_render_frame(style, cr,
(int)(wins[i].x*w/spc.width),
(int)(wins[i].y*h/spc.height),
(int)(wins[i].width*w/spc.width),
Expand Down
5 changes: 4 additions & 1 deletion src/trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ void trigger_remove ( gchar *name, GSourceFunc func, void *data )
{
GList *list, *iter;
const gchar *iname;
gpointer ptr;

if(!name || !func)
return;
Expand All @@ -73,7 +74,9 @@ void trigger_remove ( gchar *name, GSourceFunc func, void *data )
for(iter=list; iter; iter=g_list_next(iter))
if(TRIGGER(iter->data)->func==func && TRIGGER(iter->data)->data==data)
{
list = g_list_remove(list, iter->data);
ptr = iter->data;
list = g_list_remove(list, ptr);
g_free(ptr);
g_hash_table_replace(trigger_list, name, list);
return;
}
Expand Down
1 change: 1 addition & 0 deletions src/wintree.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,5 +469,6 @@ gboolean wintree_placer_calc ( gpointer wid, GdkRectangle *place )
}
g_free(x);
g_free(y);
g_free(obs);
return TRUE;
}

0 comments on commit acd84a0

Please sign in to comment.