[Lazarus] SynEdit free my TSynCompletion when freed

Martin lazarus at mfriebe.de
Sat Mar 3 14:33:38 CET 2012


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




More information about the Lazarus mailing list