Better quit handling
This commit is contained in:
25
PBMap.pb
25
PBMap.pb
@@ -25,7 +25,7 @@ UsePNGImageEncoder()
|
|||||||
|
|
||||||
DeclareModule PBMap
|
DeclareModule PBMap
|
||||||
;-Show debug infos
|
;-Show debug infos
|
||||||
Global Verbose = #True
|
Global Verbose = #false
|
||||||
Global MyDebugLevel = 3
|
Global MyDebugLevel = 3
|
||||||
Global Proxy = #False
|
Global Proxy = #False
|
||||||
Declare InitPBMap()
|
Declare InitPBMap()
|
||||||
@@ -292,18 +292,19 @@ Module PBMap
|
|||||||
;Ask main drawing thread to stop and wait for it (nicer than KillThread(PBMap\MainDrawingThread))
|
;Ask main drawing thread to stop and wait for it (nicer than KillThread(PBMap\MainDrawingThread))
|
||||||
LockMutex(PBMap\Drawing\Mutex)
|
LockMutex(PBMap\Drawing\Mutex)
|
||||||
PBMap\Drawing\End = #True
|
PBMap\Drawing\End = #True
|
||||||
;KillThread(PBMap\MainDrawingThread)
|
|
||||||
UnlockMutex(PBMap\Drawing\Mutex)
|
UnlockMutex(PBMap\Drawing\Mutex)
|
||||||
Repeat : Until Not IsThread(PBMap\MainDrawingThread)
|
Repeat : Until Not IsThread(PBMap\MainDrawingThread)
|
||||||
;wait for loading threads to finish nicely
|
;Wait for loading threads to finish nicely
|
||||||
ResetList(PBMap\TilesThreads())
|
Repeat
|
||||||
While NextElement(PBMap\TilesThreads())
|
ResetList(PBMap\TilesThreads())
|
||||||
If IsThread(PBMap\TilesThreads()\GetImageThread) = 0
|
While NextElement(PBMap\TilesThreads())
|
||||||
FreeMemory(PBMap\TilesThreads()\Tile)
|
If IsThread(PBMap\TilesThreads()\GetImageThread) = 0
|
||||||
DeleteElement(PBMap\TilesThreads())
|
FreeMemory(PBMap\TilesThreads()\Tile)
|
||||||
ResetList( PBMap\TilesThreads())
|
DeleteElement(PBMap\TilesThreads())
|
||||||
EndIf
|
EndIf
|
||||||
Wend
|
Wend
|
||||||
|
Delay(20)
|
||||||
|
Until ListSize(PBMap\TilesThreads()) = 0
|
||||||
curl_global_cleanup()
|
curl_global_cleanup()
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
@@ -1191,6 +1192,8 @@ CompilerIf #PB_Compiler_IsMainFile
|
|||||||
CompilerEndIf
|
CompilerEndIf
|
||||||
; IDE Options = PureBasic 5.50 (Windows - x64)
|
; IDE Options = PureBasic 5.50 (Windows - x64)
|
||||||
; ExecutableFormat = Console
|
; ExecutableFormat = Console
|
||||||
|
; CursorPosition = 305
|
||||||
|
; FirstLine = 278
|
||||||
; Folding = ---------
|
; Folding = ---------
|
||||||
; EnableThread
|
; EnableThread
|
||||||
; EnableXP
|
; EnableXP
|
||||||
|
Reference in New Issue
Block a user