entry-directories: protect event handling for directories
If a new desktop file is created or deleted in a monitored directory,
the desktop cache is cleared completely, and the CachedDir structure
is freed, which causes a segfault. Protect it as long as the new
event is queued and later handled.
https://bugzilla.gnome.org/show_bug.cgi?id=720460
Giovanni Campagna authored 10 years ago
Clement Lefebvre committed 6 years ago
549 | 549 | basename = g_path_get_basename (path); |
550 | 550 | |
551 | 551 | dir = cached_dir_lookup (dirname); |
552 | cached_dir_add_reference (dir); | |
552 | 553 | |
553 | 554 | if (g_str_has_suffix (basename, ".desktop") || |
554 | 555 | g_str_has_suffix (basename, ".directory")) |
655 | 656 | |
656 | 657 | cached_dir_queue_monitor_event (dir); |
657 | 658 | } |
659 | ||
660 | cached_dir_remove_reference (dir); | |
658 | 661 | } |
659 | 662 | |
660 | 663 | static void |