[omniORB] Memory management for detached omni threads

Thomas Braun thomas.braun at byte-physics.de
Thu Mar 13 20:01:26 UTC 2025


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




More information about the omniORB-list mailing list