[fpc-devel] fcl-web improvement for apache modules, question

Martin Friebe fpc at mfriebe.de
Fri Sep 19 12:01:42 CEST 2008


Michael Van Canneyt wrote:
> On Fri, 19 Sep 2008, ABorka wrote
>> Hi Michael,
>>
>> It was created in fpapache.pp in the handlerequest event.
>>
>> M:=MC.create(self);
>>
>> It worked without using the createnew, with the latest FPC source code.
>>     
> This is weird, because the code before that searches if there is an existing
> instance. If so, it should be reused ?
>
> OK, I'll have a look at it. It should probably be created with owner Nil,
> and then a unique name should be made and assigned, after which self can
> be put as the owner.
>   
Just an idea (not tested), but why creating it with owner nil, and 
assign self later.

Just immediately after the create (or better within the create) assign 
it a new unique name (using a counter, or the address in memory). Then 
when the next instance is created it can be created again with the 
default name, as all others have already new names. (Only have to make 
sure that it's done thread save, if threads are in use)

If the default name is set via the property, setter-method, then it can 
be modified there too...

Regards
Martin



More information about the fpc-devel mailing list