msvcrt: Pass on the return value in _callnewh.
Also try to avoid race conditions by storing the new handler in a local variable before checking whether it's non-null. Signed-off-by: Martin Storsjo <martin@martin.st> Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
eb5f7531ac
commit
e66758dd53
@ -234,9 +234,11 @@ int CDECL MSVCRT__set_new_mode(int mode)
|
|||||||
*/
|
*/
|
||||||
int CDECL _callnewh(MSVCRT_size_t size)
|
int CDECL _callnewh(MSVCRT_size_t size)
|
||||||
{
|
{
|
||||||
if(MSVCRT_new_handler)
|
int ret = 0;
|
||||||
(*MSVCRT_new_handler)(size);
|
MSVCRT_new_handler_func handler = MSVCRT_new_handler;
|
||||||
return 0;
|
if(handler)
|
||||||
|
ret = (*handler)(size) ? 1 : 0;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user