Module: wine Branch: master Commit: e998892a23d8923feb3adc1523ec21a8d2c13540 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e998892a23d8923feb3adc1523...
Author: Rob Shearman rob@codeweavers.com Date: Mon Jan 7 10:17:32 2008 +0000
widl: Fix the conditions under which array freeing code is output.
It doesn't matter whether or not the array is declared as a pointer or is declared using array subscripts - the array is still allocated by the unmarshalling function and so needs to be freed.
Fix a typo that caused varying arrays never to be freed.
Fix another typo with the check for conformant arrays being performed twice, redundantly.
---
tools/widl/typegen.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 3953b96..bed46aa 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -2819,14 +2819,13 @@ static void write_remoting_arg(FILE *file, int indent, const func_t *func,
if (pointer_type != RPC_FC_RP) array_type = "Pointer"; print_phase_function(file, indent, array_type, phase, var, start_offset); - if (phase == PHASE_FREE && type->declarray && pointer_type == RPC_FC_RP) + if (phase == PHASE_FREE && pointer_type == RPC_FC_RP) { - /* these are all unmarshalled by pointing into the buffer on the - * server side */ + /* these are all unmarshalled by allocating memory */ 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)) + ((type->type == RPC_FC_SMVARRAY || type->type == RPC_FC_LGVARRAY) && in_attr) || + (type->type == RPC_FC_CARRAY && !in_attr)) { print_file(file, indent, "if (%s)\n", var->name); indent++;