mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Change bro doc mode to write out docs immediately after parsing.
Originally docs were written right after parsing, but it changed to after the bro_init event happens when I was experimenting with auto-documenting logging streams by querying the LogMgr after bro_init. That experiment dead-ended, and that location is bad for other reasons: the doc framework may try to access BroObj's that have already been freed.
This commit is contained in:
parent
eb85ae9654
commit
53dc4ef084
1 changed files with 14 additions and 14 deletions
28
src/main.cc
28
src/main.cc
|
@ -740,6 +740,20 @@ int main(int argc, char** argv)
|
|||
}
|
||||
#endif
|
||||
|
||||
if ( generate_documentation )
|
||||
{
|
||||
std::list<BroDoc*>::iterator it;
|
||||
|
||||
for ( it = docs_generated.begin(); it != docs_generated.end(); ++it )
|
||||
(*it)->WriteDocFile();
|
||||
|
||||
for ( it = docs_generated.begin(); it != docs_generated.end(); ++it )
|
||||
delete *it;
|
||||
|
||||
terminate_bro();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( nerr > 0 )
|
||||
{
|
||||
delete dns_mgr;
|
||||
|
@ -975,20 +989,6 @@ int main(int argc, char** argv)
|
|||
|
||||
mgr.Drain();
|
||||
|
||||
if ( generate_documentation )
|
||||
{
|
||||
std::list<BroDoc*>::iterator it;
|
||||
|
||||
for ( it = docs_generated.begin(); it != docs_generated.end(); ++it )
|
||||
(*it)->WriteDocFile();
|
||||
|
||||
for ( it = docs_generated.begin(); it != docs_generated.end(); ++it )
|
||||
delete *it;
|
||||
|
||||
terminate_bro();
|
||||
return 0;
|
||||
}
|
||||
|
||||
have_pending_timers = ! reading_traces && timer_mgr->Size() > 0;
|
||||
|
||||
if ( io_sources.Size() > 0 || have_pending_timers )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue