[interfacekit] memory leak in BApplication
- From: burton666 <burton666@xxxxxxxxx>
- To: interfacekit <interfacekit@xxxxxxxxxxxxx>
- Date: Thu, 17 Jul 2003 10:59:51 +0200
I don't think it's much important, since as now we are not able to run
BApplications on OBOS, anyway....
there is a memory leak in Application.cpp, in the InitData method.
in this part:
// AS_CREATE_APP:
// Attach data:
// 1) port_id - receiver port of a regular app
// 2) char * - signature of the regular app
PortLink::ReplyData replydata;
PortLink *link=new PortLink(fServerFrom);
link->SetOpCode(AS_CREATE_APP);
link->Attach<int32>((int32)fServerTo);
link->Attach<int32>(_get_object_token_(this));
link->Attach((char*)signature,strlen(signature)+1);
status_t replyerr=link->FlushWithReply(&replydata);
As you see, the Portlink object is not deleted.
And here, as I told DW in a private mail about _BAppServerLink_, maybe it's
better to allocate those Portlink objects on the stack, so you just don't care
about their deletion.
I would've fixed it by myself, but since there are already two people working
on the app server, I didn't want to break/interfere with their work :P
Other related posts:
- » [interfacekit] memory leak in BApplication