]> git.tdb.fi Git - netvis.git/commitdiff
Free stuff on exit
authorMikko Rasa <tdb@tdb.fi>
Tue, 29 Apr 2008 06:05:19 +0000 (06:05 +0000)
committerMikko Rasa <tdb@tdb.fi>
Tue, 29 Apr 2008 06:05:19 +0000 (06:05 +0000)
source/netvis.cpp

index e49c28ebd9ee798127c15b27183d0979fa1fa042..3a0f09219449f46dc9bb5d1be56f116cffc0ad0b 100644 (file)
@@ -81,6 +81,8 @@ int NetVis::main()
 
        delete resolver;
 
+       delete font;
+       delete font_tex;
        delete glc;
        delete wnd;
        delete dpy;
@@ -90,6 +92,14 @@ int NetVis::main()
        cout<<"tick:    "<<profiler.scope("tick").total_time<<'\n';
        cout<<"render:  "<<profiler.scope("render").total_time<<'\n';
 
+       pcap_close(pcap);
+       for(map<unsigned, Host *>::iterator i=hosts.begin(); i!=hosts.end(); ++i)
+               delete i->second;
+       for(map<unsigned, Host *>::iterator i=disabled_hosts.begin(); i!=disabled_hosts.end(); ++i)
+               delete i->second;
+       for(list<Packet *>::iterator i=packets.begin(); i!=packets.end(); ++i)
+               delete *i;
+
        return exit_code;
 }