diff -r 976841968d74 -r 55611282b909 targets/Win32/plc_Win32_main.c --- a/targets/Win32/plc_Win32_main.c Thu Jun 07 13:45:35 2018 +0300 +++ b/targets/Win32/plc_Win32_main.c Thu Jun 07 14:04:45 2018 +0300 @@ -54,11 +54,19 @@ } } +int PLC_shutdown; + +int ForceSaveRetainReq(void) { + return PLC_shutdown; +} + /* Variable used to stop plcloop thread */ void PlcLoop() { - while(WaitForSingleObject(PLC_timer, INFINITE) == WAIT_OBJECT_0) - { + PLC_shutdown = 0; + while(!PLC_shutdown) { + if (WaitForSingleObject(PLC_timer, INFINITE) != WAIT_OBJECT_0) + PLC_shutdown = 1; PLC_timer_notify(); } } @@ -241,43 +249,6 @@ WaitForSingleObject(python_sem, INFINITE); } -#ifndef HAVE_RETAIN -void InitRetain(void) -{ -} - -void CleanupRetain(void) -{ -} - -int CheckRetainBuffer(void) -{ - return 1; -} - -void ValidateRetainBuffer(void) -{ -} - -void InValidateRetainBuffer(void) -{ -} - -void Retain(unsigned int offset, unsigned int count, void * p) -{ - /* - unsigned int position; - for(position=0; position