[haiku-bugs] Re: [Haiku] #11934: [PATCH] Solve memory leaks in Deskbar and some replicants.

  • From: "pulkomandy" <trac@xxxxxxxxxxxx>
  • Date: Tue, 07 Apr 2015 13:56:03 -0000

#11934: [PATCH] Solve memory leaks in Deskbar and some replicants.
------------------------------+----------------------------
Reporter: Barrett | Owner: stippi
Type: enhancement | Status: new
Priority: normal | Milestone: R1
Component: User Interface | Version: R1/Development
Resolution: | Keywords: Deskbar
Blocked By: | Blocking:
Has a Patch: 1 | Platform: All
------------------------------+----------------------------

Comment (by pulkomandy):

0001: isn't there a way to use a BString instead of this? If TruncateLabel
was taking a BString as a parameter and returning another BString, I think
the code would be simpler.

0002: It looks like some of the new+BAutoDeleter could be replaced with
simply allocating the BMessage on the stack. Something like this:

{{{
BMessage archivedView;
BMessage* archivedViewPtr = &archivedView;
if (message->FindMessage("view", &archivedViewPtr) == B_OK) {
}}}

These are only code readability issues, so the patch could be applied
still (not at home yet, can't do it myself).

--
Ticket URL: <https://dev.haiku-os.org/ticket/11934#comment:13>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: