openbsd-ports/x11/gnome/menus/patches/patch-libmenu_desktop-entries_c

44 lines
1.3 KiB
Plaintext

$OpenBSD: patch-libmenu_desktop-entries_c,v 1.1 2014/03/29 08:56:24 ajacoutot Exp $
From e951cfaad73000b533304b52a5dbbce23c11efd9 Mon Sep 17 00:00:00 2001
From: Jasper St. Pierre <jstpierre@mecheye.net>
Date: Mon, 18 Nov 2013 23:11:17 +0000
Subject: Revert "Memory leak fixes"
--- libmenu/desktop-entries.c.orig Sat Oct 5 01:43:39 2013
+++ libmenu/desktop-entries.c Sat Mar 29 09:32:00 2014
@@ -406,7 +406,7 @@ desktop_entry_ref (DesktopEntry *entry)
g_return_val_if_fail (entry != NULL, NULL);
g_return_val_if_fail (entry->refcount > 0, NULL);
- g_atomic_int_inc (&entry->refcount);
+ entry->refcount += 1;
return entry;
}
@@ -699,7 +699,7 @@ desktop_entry_set_ref (DesktopEntrySet *set)
g_return_val_if_fail (set != NULL, NULL);
g_return_val_if_fail (set->refcount > 0, NULL);
- g_atomic_int_inc (&set->refcount);
+ set->refcount += 1;
return set;
}
@@ -707,13 +707,11 @@ desktop_entry_set_ref (DesktopEntrySet *set)
void
desktop_entry_set_unref (DesktopEntrySet *set)
{
- gboolean is_zero;
-
g_return_if_fail (set != NULL);
g_return_if_fail (set->refcount > 0);
- is_zero = g_atomic_int_dec_and_test (&set->refcount);
- if (is_zero)
+ set->refcount -= 1;
+ if (set->refcount == 0)
{
menu_verbose (" Deleting entry set %p\n", set);