cginternals / globjects

C++ library strictly wrapping OpenGL objects.
https://globjects.org
MIT License
538 stars 59 forks source link

Fix endless loop in CompositeStringSource destructor #373

Closed j-o closed 6 years ago

j-o commented 6 years ago

deregisterListener and subsequent removeSubject do not remove the source, hence this loops forever.

scheibel commented 6 years ago

Seems like I missed this PR. Conveniently, I encountered this issue as well but found a more reasonable fix to this: https://github.com/cginternals/globjects/commit/e5a28bfd95a23768a4e6d74cce137c012c817119 There was a loop over the wrong member variable. I suppose your fix only circumvent the endless loop, but doesn't fix the actual expected behavior (deregistering of all subjects).

j-o commented 6 years ago

I was expecting both lists (m_sources and m_subjects) to contain the same set of objects.

Looking at it again, both solutions are redundant as ChangeListener's destructor has the exact same loop anyway.