POV-Ray : Newsgroups : povray.programming : Using julia_fractal as a pattern type : Re: Using julia_fractal as a pattern type Server Time
28 Jul 2024 18:27:27 EDT (-0400)
  Re: Using julia_fractal as a pattern type  
From: Ron Parker
Date: 7 Dec 1999 15:38:28
Message: <slrn84qs1r.v8.ron.parker@ron.gwmicro.com>
On Tue, 07 Dec 1999 15:24:28 -0500, Chris Huff wrote:
>In article <384d0ae5@news.povray.org>, ron### [at] povrayorg wrote:
>
>> Probably, yes.  The easiest thing to do is probably start with Chris 
>> Huff's object-based pattern code, because he's probably already gone
>> to the trouble to add a pointer to the associated object (and associated 
>> constructor/copy/destructor code) to TPAT_FIELDS.
>
>Actually, there might be a bug in the way I did it. I intended to have 
>it take a pointer to the actual object instead of copying the object to 
>the pattern structure, but the code I wrote might not have done that(due 
>to a possible misunderstanding of how identifiers are handled by the 
>parser).

Yes.  #declared objects are freed at the end of parsing.  Even if they
weren't, you run the risk of one being redefined or undefined, which would
also free them.  You must copy the object if you intend to use it later.
My functions that work with #declared objects get away with using a 
reference because they happen entirely at parse time.

-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.