mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 09:08:20 +00:00
Make sure to always delete the remote serializer.
There were two problems actually: the iomanager wasn't properly deleting sourcesl; and in some situations, the remote serialize wasn't registered with it to begin with. Addresses BIT-1306 and probably also BIT-1356.
This commit is contained in:
parent
1132470b05
commit
0620bc970a
5 changed files with 36 additions and 4 deletions
|
@ -24,6 +24,7 @@ Manager::~Manager()
|
|||
for ( SourceList::iterator i = sources.begin(); i != sources.end(); ++i )
|
||||
{
|
||||
(*i)->src->Done();
|
||||
delete (*i)->src;
|
||||
delete *i;
|
||||
}
|
||||
|
||||
|
@ -183,9 +184,24 @@ finished:
|
|||
|
||||
void Manager::Register(IOSource* src, bool dont_count)
|
||||
{
|
||||
// First see if we already have registered that source. If so, just
|
||||
// adjust dont_count.
|
||||
for ( SourceList::iterator i = sources.begin(); i != sources.end(); ++i )
|
||||
{
|
||||
if ( (*i)->src == src )
|
||||
{
|
||||
if ( (*i)->dont_count != dont_count )
|
||||
// Adjust the global counter.
|
||||
dont_counts += (dont_count ? 1 : -1);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
src->Init();
|
||||
Source* s = new Source;
|
||||
s->src = src;
|
||||
s->dont_count = dont_count;
|
||||
if ( dont_count )
|
||||
++dont_counts;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue