Ticket #12763 (closed defect: fixed)

Opened 3 years ago

Last modified 3 months ago

Override of wxLogWindow::OnFrameCreate gets never called

Reported by: MathiasDz Owned by:
Priority: low Milestone: 3.0
Component: GUI-all Version: 2.9-svn
Keywords: wxLogWindow, OnFrameCreate Cc:
Blocked By: Patch: no
Blocking:

Description

Overriding wxLogWindow::OnFrameCreate is useless, because the method gets never called.

wxLogWindow::OnFrameCreate is indirectly called (via wxLogFrame::wxLogFrame) in the wxLogWindow constructor. This calls always wxLogWindow::OnFrameCreate and never OnFrameCreate in the derived class.

A look at 2.9.1 source shows the same problem.

See also:
 http://www.parashift.com/c++-faq-lite/strange-inheritance.html
[23.5] When my base class's constructor calls a virtual function on its this object, why doesn't my derived class's override of that virtual function get invoked?

Change History

Changed 3 years ago by vadz

  • priority changed from normal to low
  • status changed from new to confirmed
  • version changed from 2.8.10 to 2.9-svn
  • component changed from base to GUI-all
  • milestone set to 3.0

I think we should just remove this method, it doesn't seem very useful (you could just as well do whatever extra initialization you need after creating wxLogWindow) and making it work would require introducing 2 step creation for wxLogWindow which I'd rather avoid.

Any objections to removing it?

Changed 3 months ago by VZ

  • status changed from confirmed to closed
  • resolution set to fixed

(In [73622]) Remove wxLogWindow::OnFrameCreate() virtual method.

This method couldn't be overridden by the classes deriving from wxLogWindow
because it was called (indirectly) from wxLogWindow ctor itself and so was
completely useless. Just remove it to avoid confusion.

Closes #12763.

Note: See TracTickets for help on using tickets.