Fix memory leak in PDF viewer

dev
Pekka Vuorela 12 years ago committed by Kristian Høgsberg
parent 2bd429b734
commit 2dbe4c632e
  1. 5
      clients/view.c

@ -220,7 +220,7 @@ view_create(struct display *display,
file = g_file_new_for_commandline_arg(filename); file = g_file_new_for_commandline_arg(filename);
basename = g_file_get_basename(file); basename = g_file_get_basename(file);
if(!basename) { if(!basename) {
title = "Wayland View"; title = g_strdup("Wayland View");
} else { } else {
title = g_strdup_printf("Wayland View - %s", basename); title = g_strdup_printf("Wayland View - %s", basename);
g_free(basename); g_free(basename);
@ -230,12 +230,13 @@ view_create(struct display *display,
NULL, &error); NULL, &error);
if(error) { if(error) {
title = "File not found"; title = g_strdup("File not found");
} }
view->window = window_create(display); view->window = window_create(display);
view->widget = frame_create(view->window, view); view->widget = frame_create(view->window, view);
window_set_title(view->window, title); window_set_title(view->window, title);
g_free(title);
view->display = display; view->display = display;
window_set_user_data(view->window, view); window_set_user_data(view->window, view);

Loading…
Cancel
Save