@@ -130,3 +130,11 @@ bool ctkDicomAbstractExchangeCache::notifyDataAvailable(const ctkDicomAppHosting
emit internalDataAvailable();
return true;
}
+
+//----------------------------------------------------------------------------
+void ctkDicomAbstractExchangeCache::cleanIncomingData()
+{
+ Q_D(ctkDicomAbstractExchangeCache);
+ d->IncomingAvailableData = ctkDicomAppHosting::AvailableData();
+ d->lastIncomingData = false;
+}
@@ -119,6 +119,14 @@ public:
*/
bool notifyDataAvailable(const ctkDicomAppHosting::AvailableData& data, bool lastData);
+ /**
+ * @brief Clean internal data stucture that keeps the incoming data.
+ *
+ * Called when other side is gone (i.e., usually the other side is a hosted app).
+ */
+ void cleanIncomingData();
Q_SIGNALS:
void dataAvailable();
@@ -163,6 +163,7 @@ void ctkExampleDicomHost::onCanceled()
void ctkExampleDicomHost::onExited()
{
qDebug() << "App exited";
+ cleanIncomingData();
//----------------------------------------------------------------------------