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
76659e9e
Commit
76659e9e
authored
Jan 20, 2004
by
Robert Reif
Committed by
Alexandre Julliard
Jan 20, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed thread handle leaks.
parent
6c8ee623
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
4 deletions
+15
-4
mciavi.c
dlls/winmm/mciavi/mciavi.c
+3
-1
mcimidi.c
dlls/winmm/mciseq/mcimidi.c
+3
-1
mciwave.c
dlls/winmm/mciwave/mciwave.c
+3
-1
playsound.c
dlls/winmm/playsound.c
+5
-1
winemm.h
dlls/winmm/winemm.h
+1
-0
No files found.
dlls/winmm/mciavi/mciavi.c
View file @
76659e9e
...
...
@@ -84,6 +84,7 @@ static DWORD CALLBACK MCI_SCAStarter(LPVOID arg)
static
DWORD
MCI_SendCommandAsync
(
UINT
wDevID
,
UINT
wMsg
,
DWORD
dwParam1
,
DWORD_PTR
dwParam2
,
UINT
size
)
{
HANDLE
handle
;
struct
SCA
*
sca
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
SCA
)
+
size
);
if
(
sca
==
0
)
...
...
@@ -103,10 +104,11 @@ static DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1,
sca
->
dwParam2
=
dwParam2
;
}
if
(
CreateThread
(
NULL
,
0
,
MCI_SCAStarter
,
sca
,
0
,
NULL
)
==
0
)
{
if
(
(
handle
=
CreateThread
(
NULL
,
0
,
MCI_SCAStarter
,
sca
,
0
,
NULL
)
)
==
0
)
{
WARN
(
"Couldn't allocate thread for async command handling, sending synchronously
\n
"
);
return
MCI_SCAStarter
(
&
sca
);
}
CloseHandle
(
handle
);
return
0
;
}
...
...
dlls/winmm/mciseq/mcimidi.c
View file @
76659e9e
...
...
@@ -127,6 +127,7 @@ static DWORD CALLBACK MCI_SCAStarter(LPVOID arg)
static
DWORD
MCI_SendCommandAsync
(
UINT
wDevID
,
UINT
wMsg
,
DWORD
dwParam1
,
DWORD
dwParam2
,
UINT
size
)
{
HANDLE
handle
;
struct
SCA
*
sca
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
SCA
)
+
size
);
if
(
sca
==
0
)
...
...
@@ -146,10 +147,11 @@ static DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1,
sca
->
dwParam2
=
dwParam2
;
}
if
(
CreateThread
(
NULL
,
0
,
MCI_SCAStarter
,
sca
,
0
,
NULL
)
==
0
)
{
if
(
(
handle
=
CreateThread
(
NULL
,
0
,
MCI_SCAStarter
,
sca
,
0
,
NULL
)
)
==
0
)
{
WARN
(
"Couldn't allocate thread for async command handling, sending synchonously
\n
"
);
return
MCI_SCAStarter
(
&
sca
);
}
CloseHandle
(
handle
);
return
0
;
}
...
...
dlls/winmm/mciwave/mciwave.c
View file @
76659e9e
...
...
@@ -97,6 +97,7 @@ static DWORD CALLBACK MCI_SCAStarter(LPVOID arg)
static
DWORD
MCI_SendCommandAsync
(
UINT
wDevID
,
UINT
wMsg
,
DWORD
dwParam1
,
DWORD
dwParam2
,
UINT
size
)
{
HANDLE
handle
;
struct
SCA
*
sca
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
SCA
)
+
size
);
if
(
sca
==
0
)
...
...
@@ -116,10 +117,11 @@ static DWORD MCI_SendCommandAsync(UINT wDevID, UINT wMsg, DWORD dwParam1,
sca
->
dwParam2
=
dwParam2
;
}
if
(
CreateThread
(
NULL
,
0
,
MCI_SCAStarter
,
sca
,
0
,
NULL
)
==
0
)
{
if
(
(
handle
=
CreateThread
(
NULL
,
0
,
MCI_SCAStarter
,
sca
,
0
,
NULL
)
)
==
0
)
{
WARN
(
"Couldn't allocate thread for async command handling, sending synchonously
\n
"
);
return
MCI_SCAStarter
(
&
sca
);
}
CloseHandle
(
handle
);
return
0
;
}
...
...
dlls/winmm/playsound.c
View file @
76659e9e
...
...
@@ -190,6 +190,7 @@ static void PlaySound_Free(WINE_PLAYSOUND* wps)
if
(
WINMM_IData
->
lpPlaySound
==
NULL
)
SetEvent
(
WINMM_IData
->
psLastEvent
);
LeaveCriticalSection
(
&
WINMM_IData
->
cs
);
if
(
wps
->
bAlloc
)
HeapFree
(
GetProcessHeap
(),
0
,
(
void
*
)
wps
->
pszSound
);
if
(
wps
->
hThread
)
CloseHandle
(
wps
->
hThread
);
HeapFree
(
GetProcessHeap
(),
0
,
wps
);
}
...
...
@@ -456,9 +457,12 @@ BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODULE hmod, DWORD fdwSound, BO
if
(
fdwSound
&
SND_ASYNC
)
{
DWORD
id
;
HANDLE
handle
;
wps
->
bLoop
=
(
fdwSound
&
SND_LOOP
)
?
TRUE
:
FALSE
;
if
(
CreateThread
(
NULL
,
0
,
proc_PlaySound
,
wps
,
0
,
&
id
)
!=
0
)
if
((
handle
=
CreateThread
(
NULL
,
0
,
proc_PlaySound
,
wps
,
0
,
&
id
))
!=
0
)
{
wps
->
hThread
=
handle
;
return
TRUE
;
}
}
else
return
proc_PlaySound
(
wps
);
...
...
dlls/winmm/winemm.h
View file @
76659e9e
...
...
@@ -193,6 +193,7 @@ typedef struct tagWINE_PLAYSOUND {
LPCWSTR
pszSound
;
HMODULE
hMod
;
DWORD
fdwSound
;
HANDLE
hThread
;
struct
tagWINE_PLAYSOUND
*
lpNext
;
}
WINE_PLAYSOUND
,
*
LPWINE_PLAYSOUND
;
...
...
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