Skip to content

Commit

Permalink
Merge pull request #257 from texel-sensei/master
Browse files Browse the repository at this point in the history
FIX: make code compile under C++20
  • Loading branch information
leochan2009 authored Aug 2, 2022
2 parents fa831f8 + c09df21 commit d4eaae9
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions Source/igtlLightObject.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -198,21 +198,9 @@ LightObject
/**
* warn user if reference counting is on and the object is being referenced
* by another object.
* a call to uncaught_exception is necessary here to avoid throwing an
* exception if one has been thrown already. This is likely to
* happen when a subclass constructor (say B) is throwing an exception: at
* that point, the stack unwinds by calling all superclass destructors back
* to this method (~LightObject): since the ref count is still 1, an
* exception would be thrown again, causing the system to abort()!
*/
if(m_ReferenceCount > 0 && !std::uncaught_exception())
if(m_ReferenceCount > 0)
{
// A general exception safety rule is that destructors should
// never throw. Something is wrong with a program that reaches
// this point anyway. Also this is the least-derived class so the
// whole object has been destroyed by this point anyway. Just
// issue a warning.
// igtlExceptionMacro(<< "Trying to delete object with non-zero reference count.");
igtlWarningMacro("Trying to delete object with non-zero reference count.");
}
}
Expand Down

0 comments on commit d4eaae9

Please sign in to comment.