|
From: | John W. Eaton |
Subject: | Re: Segmentation Fault with Octave MXE under Windows |
Date: | Thu, 29 May 2014 13:14:58 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9 |
On 05/29/2014 12:32 PM, Daniel J Sebald wrote:
If this destructor is called such that "delete rep" occurs, and then it is called again, rep is out of scope and trying to access rep->count fails.
I don't think that's supposed to happen, so there should be no need to handle the case of rep == 0.
> Try changing this hunk of code to something like the following:
virtual ~Array (void) { if (!rep) return; if (--rep->count == 0) { delete rep; rep = NULL; } } If that fixes the problem, then we need a changeset for that (one that makes sure "rep" is initialized properly at the constructor.
It is supposed to be initialized properly in every constructor, never 0. If that's not the case, can you point to a constructor where it is not initialized?
jwe
[Prev in Thread] | Current Thread | [Next in Thread] |