[Bro] deleting objects passed to BiF event handlers
James Hook
jamesfhook at gmail.com
Sat Oct 19 16:35:33 PDT 2013
Hi all,
I've just been working through the example of creating built in functions
http://www.bro.org/development/howtos/bif-doc/example.html
I have a quick question about what the design pattern should be for
deleting objects created and passed to the firing event handler. For
example, in the code below, is deleting the msg pointer likely to cause
problems to QueueEvent?
Or does the StringVal class do something clever behind the scenes to stop
memory leaks?
Many thanks in advance
James
------
msg = new StringVal("Hello, World!");
if (bif_test_event)
{
val_list *vl = new val_list;
vl->append(msg);
mgr.QueueEvent(bif_test_event, vl);
}
delete msg;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/bro/attachments/20131020/6f7f5196/attachment.html
More information about the Bro
mailing list