MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ on_detach()

void MayaFlux::Buffers::AudioComputeProcessor::on_detach ( const std::shared_ptr< Buffer > & )
overridevirtual

Called when this processor is detached from a buffer.

Parameters
bufferBuffer this processor is being detached from

Provides an opportunity for the processor to clean up buffer-specific state or release resources. With expanded processor capabilities, this method should also:

  • Release Hardware Resources: Clean up GPU memory, CUDA contexts, or other acceleration resources
  • Finalize Backend Operations: Ensure all pending backend operations are completed
  • Reset Processing State: Clear any buffer-specific optimization parameters or cached data
  • Restore Default Backend: Return to default processing backend if override was applied
  • Synchronize Operations: Ensure all parallel processing operations have completed

Default implementation does nothing, but proper resource management in derived classes is crucial for optimal performance and preventing resource leaks.

Reimplemented from MayaFlux::Buffers::BufferProcessor.

Definition at line 122 of file AudioComputeProcessor.cpp.

123{
124 m_attached.store(false, std::memory_order_seq_cst);
125 if (!m_in_flight.load(std::memory_order_seq_cst)) {
126 release(buffer);
127 }
128}
std::atomic< bool > m_attached
Set on attach, cleared on detach.
void release(const std::shared_ptr< Buffer > &buffer)
std::atomic< bool > m_in_flight
Set while processing_function runs on the processing thread.

References m_attached, m_in_flight, and release().

Here is the call graph for this function: