[haiku-bugs] [Haiku] #14413: Crash when "delete BMessage->Previous()"

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Tue, 28 Aug 2018 16:53:20 -0000

#14413: Crash when "delete BMessage->Previous()"
----------------------------------+------------------------------
 Reporter:  ahwayakchih           |        Owner:  nobody
     Type:  bug                   |       Status:  new
 Priority:  normal                |    Milestone:  Unscheduled
Component:  Kits/Application Kit  |      Version:  R1/Development
 Keywords:  BMessage, crash       |   Blocked By:
 Blocking:                        |  Has a Patch:  0
 Platform:  All                   |
----------------------------------+------------------------------
 Documentation of {{{BMessage::Previous}}} says that caller SHOULD delete
 resulting BMessage. But when i do that, BLooper crashes soon after return
 from {{{MessageReceived}}}.

 Documentation:
 https://www.haiku-
 os.org/docs/api/classBMessage.html#a57c84d02e54ef19fd1516d9bf7e3fe45

 I'm attaching mini application that shows the problem. I know it's strange
 to send message to itself, but it's to closely mimick code that discovered
 the problem.

 My Deskbar replicant has to use {{{PostMessage}}} because on Haiku it
 cannot get Deskbar location otherwise (outside of some ugly hacks):
 
https://github.com/haiku/haiku/blob/4824497d01271c34dc86e092f2df96d6352e452c/src/kits/interface/Deskbar.cpp#L121-L124
 So it posts message and waits for reply in {{{MessageReceived}}}, where it
 gets previous message to make sure it's the right reply message.

-- 
Ticket URL: <https://dev.haiku-os.org/ticket/14413>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: