1

Consider the following scenario: There is a class A, which upon construction (lets call object as objA) runs a member function run() as a glibmm thread. objA.run() is doing some intensive processing & may even be blocked on some system call waiting for IO. Now the object objA is destroyed in the main thread. What happens now? Is the behaviour undefined?

Akilan
  • 269
  • 1
  • 2
  • 9
  • 3
    Very much undefined, yes. There's nothing glibmm-specific about that; it is UB to access an object which has been destroyed. – Sneftel Jul 18 '14 at 11:46

0 Answers0