… | |
… | |
315 | |
315 | |
316 | void attachable_base::clear () |
316 | void attachable_base::clear () |
317 | { |
317 | { |
318 | //if (self) fprintf (stderr, "free_ob_self %p %s (%p,%p)\n", this, ((object *)this)->name, self, cb);//D |
318 | //if (self) fprintf (stderr, "free_ob_self %p %s (%p,%p)\n", this, ((object *)this)->name, self, cb);//D |
319 | |
319 | |
|
|
320 | if (self) |
|
|
321 | { |
|
|
322 | hv_clear ((HV *)SvRV ((SV *)self)); |
|
|
323 | sv_unmagic (SvRV ((SV *)self), PERL_MAGIC_ext); |
320 | if (self) SvREFCNT_dec (self); |
324 | SvREFCNT_dec (self); |
|
|
325 | } |
|
|
326 | |
|
|
327 | if (cb) |
|
|
328 | { |
321 | if (cb) SvREFCNT_dec (cb); |
329 | SvREFCNT_dec (cb); |
|
|
330 | cb = 0; |
|
|
331 | } |
322 | |
332 | |
|
|
333 | if (attach) |
|
|
334 | { |
323 | if (attach) free_string (attach); |
335 | free_string (attach); |
324 | |
|
|
325 | self = 0; |
|
|
326 | cb = 0; |
|
|
327 | attach = 0; |
336 | attach = 0; |
|
|
337 | } |
328 | } |
338 | } |
329 | |
339 | |
330 | void attachable_base::optimise () |
340 | void attachable_base::optimise () |
331 | { |
341 | { |
332 | if (!self) |
342 | if (!self) |