Merge pull request #236 from liskin/memleaks
fix a few memory leaks reported by valgrind
This commit is contained in:
commit
0063738754
|
@ -26,6 +26,7 @@ enum driver detect_driver(xcb_connection_t *c, backend_t *backend_data, xcb_wind
|
|||
c, xcb_randr_get_providers(c, window), NULL);
|
||||
if (r == NULL) {
|
||||
log_warn("Failed to get RANDR providers");
|
||||
free(randr_version);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -58,9 +59,11 @@ enum driver detect_driver(xcb_connection_t *c, backend_t *backend_data, xcb_wind
|
|||
ret |= DRIVER_INTEL;
|
||||
}
|
||||
free(name);
|
||||
free(r2);
|
||||
}
|
||||
free(r);
|
||||
}
|
||||
free(randr_version);
|
||||
|
||||
// If the backend supports driver detection, use that as well
|
||||
if (backend_data && backend_data->ops->detect_driver) {
|
||||
|
|
|
@ -1333,10 +1333,13 @@ static void handle_pending_updates(EV_P_ struct session *ps) {
|
|||
// Call fill_win on new windows
|
||||
handle_new_windows(ps);
|
||||
|
||||
{
|
||||
auto r = xcb_get_input_focus_reply(ps->c, xcb_get_input_focus(ps->c), NULL);
|
||||
if (!ps->active_win || (r && r->focus != ps->active_win->base.id)) {
|
||||
recheck_focus(ps);
|
||||
}
|
||||
free(r);
|
||||
}
|
||||
|
||||
// Process window updates
|
||||
refresh_windows(ps);
|
||||
|
|
Loading…
Reference in New Issue