Results 1 to 3 of 3

Thread: Control has no parent window for no apparent reason

  1. #1

    Control has no parent window for no apparent reason

    I've got a frame on a form, and the frame contains a panel. Perfectly ordinary TFrame, TForm and TPanel components--not custom components or anything--created at design-time, not set up dynamically at runtime. But when I try to close the program, I sometimes (not always) get an endless loop of "Control panel1 has no parent window!" boxes. Even setting "panel1.parent := self" in the frame's destructor doesn't fix it.

    Anyone have any idea what's going on, why it doesn't happen consistently, and how to stop it?

    Mason

  2. #2

    Control has no parent window for no apparent reason

    I would guess a "memoryleak" or something other weird happening in your code, could be anywhere.

    Did you try panel1.parent := frame in form's onDestroy event? Still, even if it works like that it doesn't change the fact there is a serious error in your code that could alter something else later or make program crash on runtime.

  3. #3

    Re: Control has no parent window for no apparent reason

    Quote Originally Posted by masonwheeler
    I've got a frame on a form, and the frame contains a panel. Perfectly ordinary TFrame, TForm and TPanel components--not custom components or anything--created at design-time, not set up dynamically at runtime. But when I try to close the program, I sometimes (not always) get an endless loop of "Control panel1 has no parent window!" boxes. Even setting "panel1.parent := self" in the frame's destructor doesn't fix it.

    Anyone have any idea what's going on, why it doesn't happen consistently, and how to stop it?

    Mason
    can you paste your code for freeing the objects?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •