cxx-qt icon indicating copy to clipboard operation
cxx-qt copied to clipboard

Add is_alive method to CxxQtThread

Open akiselev opened this issue 8 months ago • 1 comments

When combining async Rust channels and QT objects, it's really easy to end up in a situation where a message is received on the channel after the QObject has already been destroyed, causing CxxQtThread::queue to throw an exception. This PR introduces an is_alive() function to check the handle if it's been invalidated.

  • Implement is_alive method in C++ CxxQtThread class
  • Add is_alive to Rust Threading trait
  • Generate FFI bindings for is_alive in cxx-qt-gen
  • Expose is_alive as a public method on CxxQtThread in Rust
  • Update documentation for Threading trait and CxxQtThread

akiselev avatar Jun 23 '24 18:06 akiselev