Skip to content

Commit

Permalink
InterpacketGapInserter: Fixed destructor deleting context pointer whe…
Browse files Browse the repository at this point in the history
…n the timer is not scheduled.
  • Loading branch information
levy committed Oct 9, 2023
1 parent 85067dc commit a7f2f35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/inet/protocolelement/common/InterpacketGapInserter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Define_Module(InterpacketGapInserter);
InterpacketGapInserter::~InterpacketGapInserter()
{
cancelAndDelete(timer);
if (progress != nullptr)
if (progress != nullptr && progress->isScheduled())
delete static_cast<Packet *>(progress->getContextPointer());
cancelAndDeleteClockEvent(progress);
}
Expand Down

0 comments on commit a7f2f35

Please sign in to comment.