Mercurial > pidgin.yaz
comparison libpurple/imgstore.c @ 18002:38a72d6dce7f
merge of '9e832cea16395c9007bc9e384ee379b293b99abd'
and 'bda8b30520ae63b1ce117a6799cb41a65c55018d'
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Mon, 04 Jun 2007 06:32:21 +0000 |
parents | 4bb617bd3d71 |
children | 7df46d8bf114 |
comparison
equal
deleted
inserted
replaced
17707:01021bb5c709 | 18002:38a72d6dce7f |
---|---|
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24 * | 24 * |
25 */ | 25 */ |
26 | 26 |
27 #include <glib.h> | 27 #include <glib.h> |
28 #include "dbus-maybe.h" | |
28 #include "debug.h" | 29 #include "debug.h" |
29 #include "imgstore.h" | 30 #include "imgstore.h" |
30 #include "util.h" | 31 #include "util.h" |
31 | 32 |
32 static GHashTable *imgstore; | 33 static GHashTable *imgstore; |
54 | 55 |
55 g_return_val_if_fail(data != NULL, 0); | 56 g_return_val_if_fail(data != NULL, 0); |
56 g_return_val_if_fail(size > 0, 0); | 57 g_return_val_if_fail(size > 0, 0); |
57 | 58 |
58 img = g_new(PurpleStoredImage, 1); | 59 img = g_new(PurpleStoredImage, 1); |
60 PURPLE_DBUS_REGISTER_POINTER(img, PurpleStoredImage); | |
59 img->data = data; | 61 img->data = data; |
60 img->size = size; | 62 img->size = size; |
61 img->filename = g_strdup(filename); | 63 img->filename = g_strdup(filename); |
62 img->refcount = 1; | 64 img->refcount = 1; |
63 img->id = 0; | 65 img->id = 0; |
157 if (img->id) | 159 if (img->id) |
158 g_hash_table_remove(imgstore, &img->id); | 160 g_hash_table_remove(imgstore, &img->id); |
159 | 161 |
160 g_free(img->data); | 162 g_free(img->data); |
161 g_free(img->filename); | 163 g_free(img->filename); |
164 PURPLE_DBUS_UNREGISTER_POINTER(img); | |
162 g_free(img); | 165 g_free(img); |
163 img = NULL; | 166 img = NULL; |
164 } | 167 } |
165 | 168 |
166 return img; | 169 return img; |