mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Notify on source and sink create and destroy.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "SinkImpl.h"
|
||||
#include "SourceImpl.h"
|
||||
#include "Handle.h"
|
||||
#include "Notifier.h"
|
||||
|
||||
using namespace cs;
|
||||
|
||||
@@ -341,7 +342,11 @@ void ReleaseSource(CS_Source source, CS_Status* status) {
|
||||
*status = CS_INVALID_HANDLE;
|
||||
return;
|
||||
}
|
||||
if (data->refCount-- == 0) inst.Free(source);
|
||||
if (data->refCount-- == 0) {
|
||||
Notifier::GetInstance().NotifySource(data->source->GetName(), source,
|
||||
CS_SOURCE_DESTROYED);
|
||||
inst.Free(source);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -450,7 +455,11 @@ void ReleaseSink(CS_Sink sink, CS_Status* status) {
|
||||
*status = CS_INVALID_HANDLE;
|
||||
return;
|
||||
}
|
||||
if (data->refCount-- == 0) inst.Free(sink);
|
||||
if (data->refCount-- == 0) {
|
||||
Notifier::GetInstance().NotifySink(data->sink->GetName(), sink,
|
||||
CS_SINK_DESTROYED);
|
||||
inst.Free(sink);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user