Unwanted freeing of generic types

Neale Ferguson <[email protected]> Wed, 16 Aug 2017 20:57:29 +0000
Newsgroups gmane.comp.gnome.mono.devel
Message-ID <[email protected]>
If there is no error in the first loop do we still want to free each of the type_argv elements in cleanup? If they are these types are overwritten. Freeing type_argv is valid as the mono_class_inflate_generic_type_checked() makes a copy of the array.


        for (i = 0; i < ginst->type_argc; i++) {

                type_argv [i] = mono_class_inflate_generic_type_checked (ginst->type_argv [i], context, error);

                if (!mono_error_ok (error))

                        goto cleanup;

                ++count;

        }


        nginst = mono_metadata_get_generic_inst (ginst->type_argc, type_argv);

cleanup:

        for (i = 0; i < count; i++)

                mono_metadata_free_type (type_argv [i]);

        g_free (type_argv);


        return nginst;

_______________________________________________
Mono-devel-list mailing list
[email protected]
http://lists.dot.net/mailman/listinfo/mono-devel-list