Thanks for the sharp stuff, I merged all but the object->priv leak.
When a priv is set, this is either already maintained by that object, or
it should be managed yourself, for example by overriding the dtor.
Thanks for the other changes.
On Mon, 2005-03-14 at 12:11 -0300, Duilio J. Protti wrote:
> Index: libvisual/lv_object.c
> ===================================================================
> RCS file: /cvsroot/libvisual/libvisual/libvisual/lv_object.c,v
> retrieving revision 1.6
> diff -u -r1.6 lv_object.c
> --- libvisual/lv_object.c 1 Jan 2005 14:20:52 -0000 1.6
> +++ libvisual/lv_object.c 14 Mar 2005 13:16:44 -0000
> @@ -182,6 +182,9 @@
> {
> visual_log_return_val_if_fail (object != NULL, -
> VISUAL_ERROR_OBJECT_NULL);
>
> + /* mhm, this can lead to a memory leak. We must check here
> + for priv == NULL and return some -VISUAl_ERROR_NON_NULL
> + when it's not, or print some debug message at least. */
> object->priv = priv;
>
> return VISUAL_OK;
> Index: libvisual/lv_plugin.c
> ===================================================================
> RCS file: /cvsroot/libvisual/libvisual/libvisual/lv_plugin.c,v
> retrieving revision 1.64
> diff -u -r1.64 lv_plugin.c
> --- libvisual/lv_plugin.c 9 Mar 2005 12:28:34 -0000 1.64
> +++ libvisual/lv_plugin.c 14 Mar 2005 13:16:44 -0000
> @@ -419,6 +419,7 @@
> VisList *list;
> VisListEntry *entry = NULL;
> VisPluginRef *ref;
> + int ret;
>
> visual_log_return_val_if_fail (pluglist != NULL, NULL);
>
> @@ -432,11 +433,15 @@
>
> while ((ref = visual_list_next (pluglist, &entry)) != NULL) {
>
> - if (visual_plugin_type_member_of (ref->info->type,
> domain)) {
> + ret = visual_plugin_type_member_of (ref->info->type,
> domain);
> + if (ret == TRUE) {
> visual_object_ref (VISUAL_OBJECT (ref));
>
> visual_list_add (list, ref);
> }
> + else if (ret != FALSE) {
> + visual_log (VISUAL_LOG_WARNING,
> visual_error_to_string (ret));
> + }
> }
>
> return list;
> @@ -522,7 +527,8 @@
> {
> VisPluginRef **ref;
> char temp[1024];
> - int i, j, n, len;
> + int i, j, n;
> + size_t len;
> int cnt = 0;
>
> #if defined(VISUAL_OS_WIN32)
> @@ -1180,10 +1186,10 @@
> }
> }
>
> - } while (nflag = strchr (nflag, '|') + 1);
> + } while ((nflag = strchr (nflag, '|') + 1));
>
> visual_mem_free (flags);
> -
> +
> return FALSE;
> }
|