Closed Vidrep closed 5 years ago
Commenting all the fVolume lines in StationPanel.cpp (that is, disabling the volume control entirely) the app doesn't crash anymore.
I'm by no means a developer, I just have some basic understanding, but the crash seems to happen when the app tries to free the memory used by the volume slider, and it calls BInvoker's SetMessage method.
Any ideas?
UPDATE: commenting line 53 on StationPanel.cpp solves the problem, and the volume slider is back and working. I guess that line is supposed to set the tooltip to use when the slider is grabbed with the mouse, I'll check that later.
BSlider::SetModificationMessage takes ownership of the BMessage (that means will be deleted when the BSlider is deleted), BSlider::Message() returns the message passed in the BSlider constructor which also take ownership, what happens is that the message is going to be deleted two times, one time by BSlider and one time by it's father class BControl, causing a double free crash.
So to fix the issue just make a copy of the message like fVolume->SetModificationMessage(new BMessage(*theothermessage)); or something along those lines.
Aaah, good old BeAPI...
Thanks for pointing this out. Quick and simple. I've already made the change in my repo.
Feel free to submit a PR :)
Forking may be also an option if you want to maintain an abandoned program.
I've just sent a PR with various fixes (this crash, the DNS resolver thing, and some others). Please excuse any obvious flaws that may be there, as I'm not a serious coder by any means. With that in mind, it's definitely working better than before.
Launch StreamRadio, play station, stop
Close StreamRadio...crash
Link to debugger report: https://www.heypasteit.com/clip/0ISKAG