<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
</head>
<body>
<p style="margin: 0;">
<span>
<span></span>
</span>
</p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px 5px 0px;">
<br/>
Bart <bartjunk64@gmail.com> hat am 8. November 2011 um 16:39 geschrieben:
<br/>
<br/>
>[...]
<br/>
> If you run the program and press the Free button, the TSynEdit gets freed OK.
<br/>
> If however you press Ctrl+F4 and at that moment the TSynEdit has
<br/>
> focus, then you get a warning when freeing the TSynEdit:
<br/>
>
<br/>
> WARNING: TLCLComponent.Destroy with LCLRefCount>0. Hint: Maybe the component is
<br/>
> processing an event?
</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">You should not free components while they process events. </p>
<p style="margin: 0px;">Use instead:</p>
<p>Application.ReleaseComponent(Ed); </p>
<p style="margin: 0px;">This will free the component after the event. </p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px 5px 0px;">
>
<br/>
> This happened to me in an app where I create TSynEdits derived control
<br/>
> on a TTabSheet, both created at runtime on a custom TPageControl
<br/>
> derived control.
<br/>
> It took me all afternoon to find out I hadn't screwed up the
<br/>
> constructor/destructors of my own controls, and it only happened via
<br/>
> the shortcut-key when the TSynEdit had focus.
<br/>
>
<br/>
> Feauture or bug?
</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">By design. You should not free something that is in use.</p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">Mattias</p>
<p style="margin: 0px;"> </p>
</body>
</html>