comparison libpurple/imgstore.c @ 17763:74f14da7b5ab

merge of '73fe0aadf00e90ae634f0fbe253a634ce3f60b74' and 'a5d794bd32dacfb906d06a2f511405f0c865e8b9'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 25 May 2007 18:27:41 +0000
parents 4bb617bd3d71
children 7df46d8bf114
comparison
equal deleted inserted replaced
17259:5b38f5ecc49e 17763:74f14da7b5ab
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;