in reply to Re^5: semi-panic: attempt to dup freed string?
in thread semi-panic: attempt to dup freed string?
I'm looking to share a blessed reference to any arbitrary lump of memory--the struct in this example.
Skipping the intermediate SV, ie. RV->struct rather than RV->SvUV->struct seemed like a good idea as it avoided the subject error, but it doesn't work because when the RV is cloned, Perl assumes it's value is a SV* and clones that "SV" also, which screws things completely.
Using RV->SvUV->struct recreates the original problem.
I think that I should be able to prevent the SvUV being destroyed prematurely by having it's refcount incremented by the cloning process and decremented by the DESTROY method. The problem is that the CLONE method is called as a class method, not an instance method making it impossible to take full control of the cloning method.
I don;t currently see a way around this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: semi-panic: attempt to dup freed string?
by ikegami (Patriarch) on Mar 25, 2011 at 17:44 UTC | |
|
Re^7: semi-panic: attempt to dup freed string?
by ikegami (Patriarch) on Mar 25, 2011 at 18:26 UTC | |
by BrowserUk (Patriarch) on Mar 25, 2011 at 19:56 UTC | |
by ikegami (Patriarch) on Mar 25, 2011 at 20:02 UTC | |
by BrowserUk (Patriarch) on Mar 25, 2011 at 19:30 UTC | |
by ikegami (Patriarch) on Mar 25, 2011 at 20:02 UTC | |
by BrowserUk (Patriarch) on Mar 26, 2011 at 00:07 UTC | |
by ikegami (Patriarch) on Mar 26, 2011 at 02:54 UTC | |
| |
|
Re^7: semi-panic: attempt to dup freed string?
by ikegami (Patriarch) on Mar 25, 2011 at 18:40 UTC |