comparison src/image-overlay.c @ 617:aa883b6d2ef6

image_osd_info_render(): if there's no fd, just return.
author zas_
date Fri, 09 May 2008 12:43:10 +0000
parents d9c9d05c9d4d
children b1a922a32d9c
comparison
equal deleted inserted replaced
616:d9c9d05c9d4d 617:aa883b6d2ef6
281 gint with_hist = 0; 281 gint with_hist = 0;
282 gchar *ct; 282 gchar *ct;
283 gint w, h; 283 gint w, h;
284 GHashTable *vars; 284 GHashTable *vars;
285 ImageWindow *imd = osd->imd; 285 ImageWindow *imd = osd->imd;
286 FileData *fd = image_get_fd(imd);
287
288 if (!fd) return NULL;
286 289
287 vars = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free); 290 vars = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free);
288 291
289 name = image_get_name(imd); 292 name = image_get_name(imd);
290 if (name) 293 if (name)
387 g_free(ct); 390 g_free(ct);
388 g_free(name_escaped); 391 g_free(name_escaped);
389 g_hash_table_destroy(vars); 392 g_hash_table_destroy(vars);
390 393
391 { 394 {
392 FileData *fd = image_get_fd(imd);
393
394 if (fd) /* fd may be null after file deletion */
395 {
396 gint active_marks = 0; 395 gint active_marks = 0;
397 gint mark; 396 gint mark;
398 gchar *text2; 397 gchar *text2;
399 398
400 for (mark = 0; mark < FILEDATA_MARKS_SIZE; mark++) 399 for (mark = 0; mark < FILEDATA_MARKS_SIZE; mark++)
429 text2 = g_strdup(escaped_histogram_label); 428 text2 = g_strdup(escaped_histogram_label);
430 g_free(escaped_histogram_label); 429 g_free(escaped_histogram_label);
431 g_free(text); 430 g_free(text);
432 text = text2; 431 text = text2;
433 } 432 }
434 }
435 } 433 }
436 434
437 layout = gtk_widget_create_pango_layout(imd->pr, NULL); 435 layout = gtk_widget_create_pango_layout(imd->pr, NULL);
438 pango_layout_set_markup(layout, text, -1); 436 pango_layout_set_markup(layout, text, -1);
439 g_free(text); 437 g_free(text);