Skip to content

Commit a00bad2

Browse files
committed
Fix warnings from HiDPI commits
*caja-pathbar: fix warning,and in the process maybe fix occasional segfaults on opening mounted volumes from the desktop *caja-icon-info: Stop gdk_cairo_surface_create_from_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed warning by handling NULL return from function finding the pixbuf caja-icon-canvas-item-c: do not use g_object_unref where it does not work Stop the g_object_unref: assertion 'G_IS_OBJECT (object)' failed warnings on closing icon views
1 parent 9ea3b71 commit a00bad2

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

libcaja-private/caja-icon-canvas-item.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ caja_icon_canvas_item_finalize (GObject *object)
280280

281281
if (details->rendered_surface != NULL)
282282
{
283-
g_object_unref (details->rendered_surface);
283+
cairo_surface_destroy (details->rendered_surface);
284284
}
285285

286286
if (details->editable_text_layout != NULL)

libcaja-private/caja-icon-info.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,9 @@ caja_icon_info_get_surface_nodefault_at_size (CajaIconInfo *icon,
643643
cairo_surface_t *surface;
644644

645645
pixbuf = caja_icon_info_get_pixbuf_nodefault_at_size (icon, forced_size);
646+
/*catch the case of caja_icon_info_get_pixbuf_nodefault_at_size returning NULL */
647+
if (!pixbuf)
648+
return NULL;
646649
surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, icon->orig_scale, NULL);
647650
g_object_unref (pixbuf);
648651

src/caja-pathbar.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,9 +1538,13 @@ setup_file_path_mounted_mount (GFile *location, ButtonData *button_data)
15381538
GFile *root, *default_location;
15391539
gint scale;
15401540

1541+
/* Return false if button has not been set up yet or has been destroyed*/
1542+
if (!button_data->button)
1543+
return FALSE;
15411544
result = FALSE;
15421545
volume_monitor = g_volume_monitor_get ();
15431546
mounts = g_volume_monitor_get_mounts (volume_monitor);
1547+
15441548
scale = gtk_widget_get_scale_factor (GTK_WIDGET (button_data->button));
15451549
for (l = mounts; l != NULL; l = l->next)
15461550
{

0 commit comments

Comments
 (0)