pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I free cases generated by procedure??


From: John Darrington
Subject: Re: How do I free cases generated by procedure??
Date: Sun, 15 Oct 2006 09:48:15 +0800
User-agent: Mutt/1.5.4i

On Sat, Oct 14, 2006 at 04:55:13PM -0700, Ben Pfaff wrote:
     
     Got it.  Here is what I checked in.
     
     By the way, this kind of memory leak appears to originate in the
     procedure code because that's where it gets allocated it.  We
     just pass everything along with pointers from that point on.
     
     diff -u -p -r1.12 rank.q
     --- src/language/stats/rank.q      8 Oct 2006 01:49:15 -0000       1.12
     +++ src/language/stats/rank.q      14 Oct 2006 23:52:46 -0000
     @@ -626,11 +626,14 @@ rank_sorted_casefile (struct casefile *c
                          dest_idx, dest);
      
                    w = 0.0;
     +              case_destroy (&group_case);
                    case_move (&group_case, &this_case);
                  }
          if ( !value_is_missing (mv, this_value) )
            w += c;
     +          case_destroy (&this_case);
              }
     +      case_destroy (&group_case);
            rank_cases (pos, ULONG_MAX, ultimate_crit, mv, w,
                  rs, n_rank_specs, dest_idx, dest);
          }
     
I'm not sure that I fully understand that, because other procedures
don't have to destroy their own cases.

But thanks for doing it anyway.

J'


-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.


Attachment: pgpkBD0QMNTQc.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]