Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d8dc9fb3
Commit
d8dc9fb3
authored
Mar 14, 2007
by
Chris Robinson
Committed by
Alexandre Julliard
Mar 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Release objects when pins fail to connect.
parent
52529c92
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
12 deletions
+32
-12
pin.c
dlls/quartz/pin.c
+32
-12
No files found.
dlls/quartz/pin.c
View file @
d8dc9fb3
...
...
@@ -79,31 +79,40 @@ static HRESULT OutputPin_ConnectSpecific(IPin * iface, IPin * pReceivePin, const
* connected pin */
if
(
SUCCEEDED
(
hr
))
{
This
->
pMemInputPin
=
NULL
;
hr
=
IPin_QueryInterface
(
pReceivePin
,
&
IID_IMemInputPin
,
(
LPVOID
)
&
This
->
pMemInputPin
);
if
(
SUCCEEDED
(
hr
))
hr
=
IMemInputPin_GetAllocator
(
This
->
pMemInputPin
,
&
pMemAlloc
);
if
(
hr
==
VFW_E_NO_ALLOCATOR
)
{
/* Input pin provides no allocator, use standard memory allocator */
hr
=
CoCreateInstance
(
&
CLSID_MemoryAllocator
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMemAllocator
,
(
LPVOID
*
)
&
pMemAlloc
);
hr
=
IMemInputPin_GetAllocator
(
This
->
pMemInputPin
,
&
pMemAlloc
);
if
(
SUCCEEDED
(
hr
)
)
if
(
hr
==
VFW_E_NO_ALLOCATOR
)
{
hr
=
IMemInputPin_NotifyAllocator
(
This
->
pMemInputPin
,
pMemAlloc
,
FALSE
);
/* Input pin provides no allocator, use standard memory allocator */
hr
=
CoCreateInstance
(
&
CLSID_MemoryAllocator
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMemAllocator
,
(
LPVOID
*
)
&
pMemAlloc
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IMemInputPin_NotifyAllocator
(
This
->
pMemInputPin
,
pMemAlloc
,
FALSE
);
}
}
}
if
(
SUCCEEDED
(
hr
))
hr
=
IMemAllocator_SetProperties
(
pMemAlloc
,
&
This
->
allocProps
,
&
actual
);
if
(
SUCCEEDED
(
hr
))
hr
=
IMemAllocator_SetProperties
(
pMemAlloc
,
&
This
->
allocProps
,
&
actual
);
if
(
pMemAlloc
)
IMemAllocator_Release
(
pMemAlloc
);
if
(
pMemAlloc
)
IMemAllocator_Release
(
pMemAlloc
);
}
/* break connection if we couldn't get the allocator */
if
(
FAILED
(
hr
))
{
if
(
This
->
pMemInputPin
)
IMemInputPin_Release
(
This
->
pMemInputPin
);
This
->
pMemInputPin
=
NULL
;
IPin_Disconnect
(
pReceivePin
);
}
}
if
(
FAILED
(
hr
))
...
...
@@ -1069,6 +1078,8 @@ HRESULT WINAPI PullPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const
}
}
This
->
pReader
=
NULL
;
This
->
pAlloc
=
NULL
;
if
(
SUCCEEDED
(
hr
))
{
hr
=
IPin_QueryInterface
(
pReceivePin
,
&
IID_IAsyncReader
,
(
LPVOID
*
)
&
This
->
pReader
);
...
...
@@ -1095,6 +1106,15 @@ HRESULT WINAPI PullPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const
This
->
pin
.
pConnectedTo
=
pReceivePin
;
IPin_AddRef
(
pReceivePin
);
}
else
{
if
(
This
->
pReader
)
IAsyncReader_Release
(
This
->
pReader
);
This
->
pReader
=
NULL
;
if
(
This
->
pAlloc
)
IMemAllocator_Release
(
This
->
pAlloc
);
This
->
pAlloc
=
NULL
;
}
}
LeaveCriticalSection
(
This
->
pin
.
pCritSec
);
return
hr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment