commit: add g_free to code generated
- From: Frank Rehberger <Frank Rehberger web de>
- To: "orbit-list gnome org" <orbit-list gnome org>
- Subject: commit: add g_free to code generated
- Date: Sat, 15 Nov 2003 23:40:21 +0100
Hello,
The patch affects generated code by orbit-idl compiler.
Generated destructors will free allocacted memory finally, ie:
static void
impl_Echo__destroy(impl_POA_Echo * servant, CORBA_Environment * ev)
{
CORBA_Object_release((CORBA_Object) servant->poa, ev);
/* No further remote method calls are delegated to
* servant and you may free your private attributes. */
/* ------ free private attributes here ------ */
/* ------ ---------- end ------------- ------ */
POA_Echo__fini((PortableServer_Servant) servant, ev);
g_free(servant);
}
Index: src/idl-compiler/orbit-idl-c-skelimpl.c
===================================================================
RCS file: /cvs/gnome/ORBit2/src/idl-compiler/orbit-idl-c-skelimpl.c,v
retrieving revision 1.11
diff -u -r1.11 orbit-idl-c-skelimpl.c
--- src/idl-compiler/orbit-idl-c-skelimpl.c 26 May 2003 01:00:43 -0000 1.11
+++ src/idl-compiler/orbit-idl-c-skelimpl.c 15 Nov 2003 22:25:35 -0000
@@ -492,7 +492,9 @@
fprintf(ski->of, " /* ------ free private attributes here ------ */\n");
fprintf(ski->of, " /* ------ ---------- end ------------- ------ */\n");
fprintf(ski->of, "\nPOA_%s__fini((PortableServer_Servant)servant, ev);\n", id);
+ fprintf(ski->of, "\ng_free (servant);\n");
fprintf(ski->of, "}\n\n");
+
subski.tree = IDL_INTERFACE(ski->tree).body;
cbe_ski_do_list(&subski);
IDL_tree_traverse_parents(ski->tree, (GFunc)&cbe_ski_do_inherited_methods,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]