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?
Asked
Active
Viewed 72 times
1

Akilan
- 269
- 1
- 2
- 9
-
3Very 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