#14413 closed bug (fixed)
Crash when "delete BMessage->Previous()"
Reported by: | ahwayakchih | Owned by: | nielx |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Documentation | Version: | R1/Development |
Keywords: | BMessage, crash | Cc: | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
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.
Attachments (2)
Change History (5)
by , 6 years ago
Attachment: | test-bmsg-previous-delete.cpp added |
---|
by , 6 years ago
Attachment: | test-bmsg-previous-delete.2.cpp added |
---|
same test app, fixed to post message after ready to run, as advised by PulkoMandy
comment:1 by , 6 years ago
PulkoMandy said that message should never be deleted, so i checked BeBook (should ahve done that in the first place... sorry) and it looks like it does not mention deleting at all.
So this bug is about invalid description of BMessage::Previous
in HaikuBook.
comment:2 by , 6 years ago
Component: | Kits/Application Kit → Documentation |
---|---|
Owner: | changed from | to
Resolution: | → fixed |
Status: | new → closed |
Fixed in hrev52296. Also submitted to Gerrit for inclusion in r1b1 as https://review.haiku-os.org/#/c/haiku/+/488/
test application to run with or without deleting previous BMessage