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
d67f35b9
Commit
d67f35b9
authored
May 31, 2014
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jun 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Don't leak memory on DirectMusicInstrument creation failure.
Also lock/unlock the module only on creation/destruction of the object.
parent
096bfbd2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
instrument.c
dlls/dmusic/instrument.c
+11
-8
No files found.
dlls/dmusic/instrument.c
View file @
d67f35b9
...
...
@@ -62,8 +62,6 @@ static ULONG WINAPI IDirectMusicInstrumentImpl_AddRef(LPDIRECTMUSICINSTRUMENT if
TRACE
(
"(%p)->(): new ref = %u
\n
"
,
iface
,
ref
);
DMUSIC_LockModule
();
return
ref
;
}
...
...
@@ -83,10 +81,9 @@ static ULONG WINAPI IDirectMusicInstrumentImpl_Release(LPDIRECTMUSICINSTRUMENT i
HeapFree
(
GetProcessHeap
(),
0
,
This
->
articulations
->
connections
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
articulations
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
DMUSIC_UnlockModule
();
}
DMUSIC_UnlockModule
();
return
ref
;
}
...
...
@@ -125,16 +122,22 @@ static const IDirectMusicInstrumentVtbl DirectMusicInstrument_Vtbl =
/* for ClassFactory */
HRESULT
DMUSIC_CreateDirectMusicInstrumentImpl
(
LPCGUID
lpcGUID
,
LPVOID
*
ppobj
,
LPUNKNOWN
pUnkOuter
)
{
IDirectMusicInstrumentImpl
*
dminst
;
HRESULT
hr
;
dminst
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirectMusicInstrumentImpl
));
if
(
NULL
==
dminst
)
{
*
ppobj
=
NULL
;
return
E_OUTOFMEMORY
;
}
dminst
->
IDirectMusicInstrument_iface
.
lpVtbl
=
&
DirectMusicInstrument_Vtbl
;
dminst
->
ref
=
0
;
/* will be inited by QueryInterface */
return
IDirectMusicInstrument_QueryInterface
(
&
dminst
->
IDirectMusicInstrument_iface
,
lpcGUID
,
ppobj
);
dminst
->
ref
=
1
;
DMUSIC_LockModule
();
hr
=
IDirectMusicInstrument_QueryInterface
(
&
dminst
->
IDirectMusicInstrument_iface
,
lpcGUID
,
ppobj
);
IDirectMusicInstrument_Release
(
&
dminst
->
IDirectMusicInstrument_iface
);
return
hr
;
}
static
HRESULT
read_from_stream
(
IStream
*
stream
,
void
*
data
,
ULONG
size
)
...
...
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