Code review comment for lp:~vkolesnikov/pbxt/pbxt-mem-debugger-and-leaks

Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Hi Vlad,

I am wondering why this is necessary!

Surely "fkey->co_name" should be freed by: key->release(self).

key->release(self) should call XTDDConstraint::finalize():

 virtual void finalize(XTThreadPtr self) {
  if (co_name)
   xt_free(self, co_name);
  if (co_ind_name)
   xt_free(self, co_ind_name);
  co_cols.deleteAll(self);
  XTObject::finalize(self);
 }

fkey is a XTDDForeignKey which is a XTDDIndex which is a XTDDConstraint.

On Mar 11, 2009, at 4:45 PM, Vladimir Kolesnikov wrote:

> === modified file 'src/datadic_xt.cc'
> --- src/datadic_xt.cc 2009-01-21 13:55:57 +0000
> +++ src/datadic_xt.cc 2009-03-11 15:38:29 +0000
> @@ -1513,6 +1513,7 @@
> for (i=0; i<ct_curr_table->dt_fkeys.size(); i++) {
> fkey = ct_curr_table->dt_fkeys.itemAt(i);
> if (fkey->co_name && myxt_strcasecmp(con_name, fkey->co_name) ==
> 0) {
> + xt_free(self, fkey->co_name);
> ct_curr_table->dt_fkeys.remove(fkey);
> fkey->release(self);
> }

--
Paul McCullagh
PrimeBase Technologies
www.primebase.org
www.blobstreaming.org
pbxt.blogspot.com

« Back to merge proposal