[Lazarus] SynEdit free my TSynCompletion when freed

Martin lazarus at mfriebe.de
Sat Mar 3 14:39:19 CET 2012


On 03/03/2012 13:33, Martin wrote:
> On 03/03/2012 13:29, Martin wrote:
>> On 03/03/2012 12:59, Zaher Dirkey wrote:
>>> Hi i have global TSynCompletion for muliple synedit, i created it 
>>> like this
>>>
>>>   FCompletion := TSynCompletion.Create(nil);
>>>   FCompletion.Width := 340;
>>>   FCompletion.EndOfTokenChr := '{}()[].<>/\:!$&*+-=%';
>>>   FCompletion.OnExecute := @OnExecuteCompletion;
>>>   FCompletion.ShortCut := scCtrl + VK_SPACE;
>>>   FCompletion.CaseSensitive := False;
>>>   FCompletion.AddEditor(vSynEdit);
>>>
>>> But when free the TSynEdit component it free that global 
>>> FCompletion, how can resolve it?
>>
>> Create the SynCompletion with an owner. Any owner will do.
>>
>
> Actually, if you added ass the synedit, then only the last should 
> destroy it
>
>
> So if it is freed, while having any added SynEdit ,then you found a bug

Added to changes

http://wiki.lazarus.freepascal.org/Lazarus_0.99.0_release_notes#SynEdit:_TSynCompletion






More information about the Lazarus mailing list