Bug 340 - OnOff crashes if Stop() is called without Start() having been called before
OnOff crashes if Stop() is called without Start() having been called before
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: applications
ns-3.2
All All
: P3 minor
Assigned To: Rajib Bhattacharjea
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-12 13:52 UTC by Gustavo J. A. M. Carneiro
Modified: 2008-10-27 15:13 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo J. A. M. Carneiro 2008-09-12 13:52:36 UTC
145	void OnOffApplication::StopApplication() // Called at time specified by Stop
146	{
147	  NS_LOG_FUNCTION_NOARGS ();
148	
149	  CancelEvents ();
150	  m_socket->Close ();
151	}

If the application hasn't started, m_socket is NULL.  Maybe it's better to add an assert, not sure.
Comment 1 Mathieu Lacage 2008-10-20 08:19:32 UTC
it seems that we can trivially check for m_socket != 0
Comment 2 Rajib Bhattacharjea 2008-10-27 15:13:17 UTC
changeset 3819	37b316422064