Rob Shearman : widl: Tweak the rules for when to call pfnFree for arrays.

Alexandre Julliard julliard at winehq.org
Fri Dec 21 07:28:26 CST 2007


Module: wine
Branch: master
Commit: b57a322b0268e6904d23b65cb2cd65045bed021d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b57a322b0268e6904d23b65cb2cd65045bed021d

Author: Rob Shearman <rob at codeweavers.com>
Date:   Fri Dec 21 09:41:40 2007 +0000

widl: Tweak the rules for when to call pfnFree for arrays.

Varying arrays that aren't unmarshalled shouldn't be freed, but 
conformant arrays that aren't unmarshalled should.

---

 tools/widl/typegen.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index b0edc29..d245c97 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -2765,9 +2765,10 @@ static void write_remoting_arg(FILE *file, int indent, const func_t *func,
         {
             /* these are all unmarshalled by pointing into the buffer on the
              * server side */
-            if (type->type != RPC_FC_SMFARRAY &&
-                type->type != RPC_FC_LGFARRAY &&
-                type->type != RPC_FC_CARRAY)
+            if (type->type == RPC_FC_BOGUS_ARRAY ||
+                type->type == RPC_FC_CVARRAY ||
+                (type->type == RPC_FC_SMVARRAY && type->type == RPC_FC_LGVARRAY && in_attr) ||
+                (type->type == RPC_FC_CARRAY && type->type == RPC_FC_CARRAY && !in_attr))
             {
                 print_file(file, indent, "if (%s)\n", var->name);
                 indent++;




More information about the wine-cvs mailing list