[Haiku-bugs] [Haiku] #2762: media player consistently crashes
jackburton
trac at haiku-os.org
Sat Sep 27 15:35:41 CEST 2008
#2762: media player consistently crashes
---------------------------------------+------------------------------------
Reporter: kvdman | Owner: stippi
Type: bug | Status: new
Priority: normal | Milestone: R1
Component: Applications/MediaPlayer | Version: R1 development
Resolution: | Blockedby:
Platform: All | Blocking:
---------------------------------------+------------------------------------
Comment(by jackburton):
I think I've found the problem, but I don't have any idea on how to solve
this correctly.
Basically, what happens is that The window thread starts (sometimes)
before the MainApp constructor returns, and receives a B_WINDOW_ACTIVATED
message from the app_server. Then, the WindowActivated() code calls
Controller::PlayerActivated(), which in turn dereferences gMainApp.
gMainApp isn't yet initialized, since the MainApp constructor hasn't
returned yet.
I've fixed the crash by initializing gMainApp in the MainApp constructor,
like this:
gMainApp = be_app
and moving the creation of the window after that line.
But again, I'm not sure it's a good solution.
Maybe we should, in some way, delay the activation of the window after the
BApplication has been run.
--
Ticket URL: <http://dev.haiku-os.org/ticket/2762#comment:5>
Haiku <http://dev.haiku-os.org>
The Haiku operating system.
More information about the Haiku-bugs
mailing list