Memory management for detached omni threads
Thomas Braun via omniORB-list <[email protected]> Thu, 13 Mar 2025 21:01:26 +0100
| Newsgroups | gmane.comp.corba.omniorb.user |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I recently stumbled upon cppTango code like
// ...
auto *th = new DelayedEventSubThread(...);
th->start();
// th goes out of scope
with the declaration
class DelayedEventSubThread : public omni_thread
{
public:
DelayedEventSubThread(...);
void run(void *) override;
// ...
}
Now from my reading of [1] I'd say that this is a detached omni thread,
right?
But what I don't understand is why this does not leak memory?
I also had a look at omniORB/src/examples/thread/diner.cc and there I'd
also expect a memory leak as
phillies[id] = NULL;
is done without deleting the object first. But my tooling (gcc/clang
with ASAN sanitizer) tells me that everthing is good.
Thanks,
Thomas
[1]: https://omniorb.net/omni43/omnithread.html