Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e8d89cd0
Commit
e8d89cd0
authored
Sep 28, 2004
by
Huw Davies
Committed by
Alexandre Julliard
Sep 28, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a reference leak on failure (spotted by Rob Shearman).
Move some code over to the Interlocked* functions.
parent
076b5b70
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
78 additions
and
82 deletions
+78
-82
main.c
dlls/amstream/main.c
+15
-15
main.c
dlls/d3dxof/main.c
+6
-11
main.c
dlls/ddraw/main.c
+13
-9
dpnet_main.c
dlls/dpnet/dpnet_main.c
+2
-2
dxdiag_main.c
dlls/dxdiagn/dxdiag_main.c
+2
-2
itss.c
dlls/itss/itss.c
+14
-15
mlang.c
dlls/mlang/mlang.c
+12
-13
main.c
dlls/quartz/main.c
+14
-15
No files found.
dlls/amstream/main.c
View file @
e8d89cd0
...
...
@@ -95,15 +95,17 @@ AMCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
AMCF_AddRef
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
AMCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
AMCF_Release
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
AMCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
ULONG
ref
=
--
This
->
ref
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
...
...
@@ -113,28 +115,26 @@ static ULONG WINAPI AMCF_Release(LPCLASSFACTORY iface) {
static
HRESULT
WINAPI
AMCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
HRESULT
hres
;
LPUNKNOWN
punk
;
TRACE
(
"(%p)->(%p,%s,%p)
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
*
ppobj
=
NULL
;
hres
=
This
->
pfnCreateInstance
(
pOuter
,
(
LPVOID
*
)
&
punk
);
if
(
FAILED
(
hres
))
{
*
ppobj
=
NULL
;
return
hres
;
}
hres
=
IUnknown_QueryInterface
(
punk
,
riid
,
ppobj
);
if
(
FAILED
(
hres
))
{
*
ppobj
=
NULL
;
return
hres
;
if
(
SUCCEEDED
(
hres
))
{
hres
=
IUnknown_QueryInterface
(
punk
,
riid
,
ppobj
);
IUnknown_Release
(
punk
);
}
IUnknown_Release
(
punk
);
return
hres
;
}
static
HRESULT
WINAPI
AMCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
static
HRESULT
WINAPI
AMCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p)->(%d),stub!
\n
"
,
This
,
dolock
);
return
S_OK
;
...
...
dlls/d3dxof/main.c
View file @
e8d89cd0
...
...
@@ -97,14 +97,14 @@ static HRESULT WINAPI XFCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid, LPVO
static
ULONG
WINAPI
XFCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
XFCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
ULONG
ref
=
--
This
->
ref
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
...
...
@@ -120,17 +120,12 @@ static HRESULT WINAPI XFCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter
TRACE
(
"(%p)->(%p,%s,%p)
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
*
ppobj
=
NULL
;
hres
=
This
->
pfnCreateInstance
(
pOuter
,
(
LPVOID
*
)
&
punk
);
if
(
FAIL
ED
(
hres
))
{
*
ppobj
=
NULL
;
return
hres
;
if
(
SUCCEED
ED
(
hres
))
{
hres
=
IUnknown_QueryInterface
(
punk
,
riid
,
ppobj
)
;
IUnknown_Release
(
punk
)
;
}
hres
=
IUnknown_QueryInterface
(
punk
,
riid
,
ppobj
);
if
(
FAILED
(
hres
))
{
*
ppobj
=
NULL
;
return
hres
;
}
IUnknown_Release
(
punk
);
return
hres
;
}
...
...
dlls/ddraw/main.c
View file @
e8d89cd0
...
...
@@ -491,29 +491,32 @@ DDCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
DDCF_AddRef
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
DDCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p)->() incrementing from %ld.
\n
"
,
This
,
This
->
ref
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
DDCF_Release
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
DDCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->() decrementing from %ld.
\n
"
,
This
,
ref
+
1
);
TRACE
(
"(%p)->() decrementing from %ld.
\n
"
,
This
,
This
->
ref
);
if
(
--
This
->
ref
==
0
)
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
This
->
ref
;
return
ref
;
}
static
HRESULT
WINAPI
DDCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
TRACE
(
"(%p)->(%p,%s,%p)
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
...
...
@@ -521,7 +524,8 @@ static HRESULT WINAPI DDCF_CreateInstance(
return
This
->
pfnCreateInstance
(
pOuter
,
riid
,
ppobj
);
}
static
HRESULT
WINAPI
DDCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
static
HRESULT
WINAPI
DDCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p)->(%d),stub!
\n
"
,
This
,
dolock
);
return
S_OK
;
...
...
dlls/dpnet/dpnet_main.c
View file @
e8d89cd0
...
...
@@ -80,13 +80,13 @@ static HRESULT WINAPI DICF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOI
static
ULONG
WINAPI
DICF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
DICF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
--
(
This
->
ref
);
return
InterlockedDecrement
(
&
This
->
ref
);
}
static
HRESULT
WINAPI
DICF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
...
...
dlls/dxdiagn/dxdiag_main.c
View file @
e8d89cd0
...
...
@@ -55,13 +55,13 @@ static HRESULT WINAPI DXDiagCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,L
static
ULONG
WINAPI
DXDiagCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
DXDiagCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
--
(
This
->
ref
);
return
InterlockedDecrement
(
&
This
->
ref
);
}
static
HRESULT
WINAPI
DXDiagCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
...
...
dlls/itss/itss.c
View file @
e8d89cd0
...
...
@@ -103,15 +103,17 @@ ITSSCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
ITSSCF_AddRef
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
ITSSCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
ITSSCF_Release
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
ITSSCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
ULONG
ref
=
--
This
->
ref
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
...
...
@@ -121,28 +123,25 @@ static ULONG WINAPI ITSSCF_Release(LPCLASSFACTORY iface) {
static
HRESULT
WINAPI
ITSSCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
HRESULT
hres
;
LPUNKNOWN
punk
;
TRACE
(
"(%p)->(%p,%s,%p)
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
*
ppobj
=
NULL
;
hres
=
This
->
pfnCreateInstance
(
pOuter
,
(
LPVOID
*
)
&
punk
);
if
(
FAILED
(
hres
))
{
*
ppobj
=
NULL
;
return
hres
;
}
hres
=
IUnknown_QueryInterface
(
punk
,
riid
,
ppobj
);
if
(
FAILED
(
hres
))
{
*
ppobj
=
NULL
;
return
hres
;
if
(
SUCCEEDED
(
hres
))
{
hres
=
IUnknown_QueryInterface
(
punk
,
riid
,
ppobj
);
IUnknown_Release
(
punk
);
}
IUnknown_Release
(
punk
);
return
hres
;
}
static
HRESULT
WINAPI
ITSSCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
static
HRESULT
WINAPI
ITSSCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p)->(%d),stub!
\n
"
,
This
,
dolock
);
return
S_OK
;
...
...
dlls/mlang/mlang.c
View file @
e8d89cd0
...
...
@@ -681,12 +681,14 @@ MLANGCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
MLANGCF_AddRef
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
MLANGCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
MLANGCF_Release
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
MLANGCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
...
...
@@ -701,29 +703,26 @@ static ULONG WINAPI MLANGCF_Release(LPCLASSFACTORY iface) {
}
static
HRESULT
WINAPI
MLANGCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
HRESULT
hres
;
LPUNKNOWN
punk
;
TRACE
(
"(%p)->(%p,%s,%p)
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
*
ppobj
=
NULL
;
hres
=
This
->
pfnCreateInstance
(
pOuter
,
(
LPVOID
*
)
&
punk
);
if
(
FAIL
ED
(
hres
))
{
*
ppobj
=
NULL
;
return
hres
;
if
(
SUCCEED
ED
(
hres
))
{
hres
=
IUnknown_QueryInterface
(
punk
,
riid
,
ppobj
)
;
IUnknown_Release
(
punk
)
;
}
hres
=
IUnknown_QueryInterface
(
punk
,
riid
,
ppobj
);
if
(
FAILED
(
hres
))
{
*
ppobj
=
NULL
;
return
hres
;
}
IUnknown_Release
(
punk
);
TRACE
(
"returning (%p) -> %lx
\n
"
,
*
ppobj
,
hres
);
return
hres
;
}
static
HRESULT
WINAPI
MLANGCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
static
HRESULT
WINAPI
MLANGCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p)->(%d),stub!
\n
"
,
This
,
dolock
);
return
S_OK
;
...
...
dlls/quartz/main.c
View file @
e8d89cd0
...
...
@@ -89,15 +89,17 @@ DSCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj)
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
DSCF_AddRef
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
DSCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
DSCF_Release
(
LPCLASSFACTORY
iface
)
{
static
ULONG
WINAPI
DSCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
ULONG
ref
=
--
This
->
ref
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
)
;
if
(
ref
==
0
)
HeapFree
(
GetProcessHeap
(),
0
,
This
);
...
...
@@ -107,28 +109,25 @@ static ULONG WINAPI DSCF_Release(LPCLASSFACTORY iface) {
static
HRESULT
WINAPI
DSCF_CreateInstance
(
LPCLASSFACTORY
iface
,
LPUNKNOWN
pOuter
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
REFIID
riid
,
LPVOID
*
ppobj
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
HRESULT
hres
;
LPUNKNOWN
punk
;
TRACE
(
"(%p)->(%p,%s,%p)
\n
"
,
This
,
pOuter
,
debugstr_guid
(
riid
),
ppobj
);
*
ppobj
=
NULL
;
hres
=
This
->
pfnCreateInstance
(
pOuter
,
(
LPVOID
*
)
&
punk
);
if
(
FAIL
ED
(
hres
))
{
*
ppobj
=
NULL
;
return
hres
;
if
(
SUCCEED
ED
(
hres
))
{
hres
=
IUnknown_QueryInterface
(
punk
,
riid
,
ppobj
)
;
IUnknown_Release
(
punk
)
;
}
hres
=
IUnknown_QueryInterface
(
punk
,
riid
,
ppobj
);
if
(
FAILED
(
hres
))
{
*
ppobj
=
NULL
;
return
hres
;
}
IUnknown_Release
(
punk
);
return
hres
;
}
static
HRESULT
WINAPI
DSCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
static
HRESULT
WINAPI
DSCF_LockServer
(
LPCLASSFACTORY
iface
,
BOOL
dolock
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
FIXME
(
"(%p)->(%d),stub!
\n
"
,
This
,
dolock
);
return
S_OK
;
...
...
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