[Pharo-project] FreeType and finalization
siguctua at gmail.com
Tue Oct 12 09:29:46 EDT 2010
I can modify Freetype to not use subclass of weakregistry,
and still guarantee non-duplication.
Is Freetype a separate maintained package, or its part of Pharo core?
On 12 October 2010 16:25, Gary Chambers <gazzaguru2 at btinternet.com> wrote:
> Indeed... never seen that error hence proposal for simplest solution.
> Regards, Gary
> ----- Original Message ----- From: "Igor Stasenko" <siguctua at gmail.com>
> To: <Pharo-project at lists.gforge.inria.fr>
> Sent: Tuesday, October 12, 2010 1:21 PM
> Subject: Re: [Pharo-project] FreeType and finalization
>> 2010/10/12 Gary Chambers <gazzaguru2 at btinternet.com>:
>>> Hi all, I've encountered a problem with FreeType with respect to the new
>>> finalization scheme.
>>> Regards, Gary
>> FT2HandleRegistry overrides following method:
>> add: anObject
>> "Add anObject to the receiver. Store the object as well as the
>> associated executor."
>> | executor dup |
>> executor := anObject executor.
>> dup := nil.
>> self protected:[
>> dup := valueDictionary detect: [ :v | v handle = executor handle ]
>> ifNone: [ ].
>> valueDictionary at: anObject put: executor.
>> dup ifNotNil: [ self error: 'Duplicate object added!'. self remove:
>> anObject ].
>> As i see, the intent is to prevent registering a same handle twice,
>> so in own turn, when time will come, a #finalize won't attempt to
>> destroy same handle twice.
>> The proposed fix (as you wrote in issue tracker)
>> ^Registry ifNil: [ Registry := WeakRegistry new]
>> appears to fix the problem...
>> But apparently its not the same as in original.
>> Okay, but since we never seen the error: 'Duplicate object added!',
>> then i think it may work without it :)
>> Still, it would be good to know, how handles are created, and what the
>> chances that they could be duplicated.
>> Best regards,
>> Igor Stasenko AKA sig.
>> Pharo-project mailing list
>> Pharo-project at lists.gforge.inria.fr
> Pharo-project mailing list
> Pharo-project at lists.gforge.inria.fr
Igor Stasenko AKA sig.
More information about the Pharo-dev