Bart <[email protected]> hat am 8. November 2011 um 16:39 geschrieben: >[...] > If you run the program and press the Free button, the TSynEdit gets freed OK. > If however you press Ctrl+F4 and at that moment the TSynEdit has > focus, then you get a warning when freeing the TSynEdit: > > WARNING: TLCLComponent.Destroy with LCLRefCount>0. Hint: Maybe the component > is > processing an event? You should not free components while they process events. Use instead: Application.ReleaseComponent(Ed); This will free the component after the event. > > This happened to me in an app where I create TSynEdits derived control > on a TTabSheet, both created at runtime on a custom TPageControl > derived control. > It took me all afternoon to find out I hadn't screwed up the > constructor/destructors of my own controls, and it only happened via > the shortcut-key when the TSynEdit had focus. > > Feauture or bug? By design. You should not free something that is in use. Mattias
-- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
