release on demand sync
authorVolker Birk <vb@pep.foundation>
Mon, 22 Oct 2018 23:00:25 +0200
branchsync
changeset 312d95c3cc4c2fa
parent 311 9355fb3f47bb
child 313 eec9885e1222
release on demand
CpEpEngine.cpp
     1.1 --- a/CpEpEngine.cpp	Mon Oct 22 22:44:13 2018 +0200
     1.2 +++ b/CpEpEngine.cpp	Mon Oct 22 23:00:25 2018 +0200
     1.3 @@ -736,7 +736,7 @@
     1.4      return _ident;
     1.5  }
     1.6  
     1.7 -static IpEpEngineCallbacks * _unmarshaled_consumer(CpEpEngine::callback_container::Container::const_iterator p)
     1.8 +static IpEpEngineCallbacks * _unmarshaled_consumer(CpEpEngine::callback_container::Container::iterator p)
     1.9  {
    1.10      if (!p->cdata && p->pdata && p->pdata->marshaled) {
    1.11          HRESULT r = CoGetInterfaceAndReleaseStream(p->pdata->marshaled, IID_IpEpEngineCallbacks, (LPVOID*) &p->cdata);
    1.12 @@ -744,6 +744,10 @@
    1.13              throw runtime_error("_unmarshaled_consumer(): CoGetInterfaceAndReleaseStream() failed");
    1.14          p->pdata->marshaled = nullptr;
    1.15      }
    1.16 +    else if (p->cdata && !p->pdata) {
    1.17 +        p->cdata->Release();
    1.18 +        p->cdata = nullptr;
    1.19 +    }
    1.20  
    1.21      return p->cdata;
    1.22  }