mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
ComSmartPtr: Make ownership more explicit
COM objects now always start with a refcount of 1, as is convention.
This commit is contained in:
parent
fe9fc0c0e6
commit
1f9ba0682c
12 changed files with 78 additions and 47 deletions
|
|
@ -111,7 +111,7 @@ struct CameraDevice::Pimpl : public ChangeBroadcaster
|
|||
sampleGrabber->SetMediaType (&mt);
|
||||
}
|
||||
|
||||
callback = new GrabberCallback (*this);
|
||||
callback = becomeComSmartPtrOwner (new GrabberCallback (*this));
|
||||
hr = sampleGrabber->SetCallback (callback, 1);
|
||||
|
||||
hr = graphBuilder->AddFilter (sampleGrabberBase, _T ("Sample Grabber"));
|
||||
|
|
@ -536,8 +536,8 @@ struct CameraDevice::Pimpl : public ChangeBroadcaster
|
|||
|
||||
struct GrabberCallback : public ComBaseClassHelperBase<ComTypes::ISampleGrabberCB>
|
||||
{
|
||||
GrabberCallback (Pimpl& p)
|
||||
: ComBaseClassHelperBase (0), owner (p) {}
|
||||
explicit GrabberCallback (Pimpl& p)
|
||||
: owner (p) {}
|
||||
|
||||
JUCE_COMRESULT QueryInterface (REFIID refId, void** result) override
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue