GUI: make backupTimer atomic
This commit is contained in:
		
							parent
							
								
									409d3c26af
								
							
						
					
					
						commit
						c5259066e1
					
				|  | @ -3550,7 +3550,7 @@ bool FurnaceGUI::loop() { | |||
|     // backup trigger
 | ||||
|     if (modified) { | ||||
|       if (backupTimer>0) { | ||||
|         backupTimer-=ImGui::GetIO().DeltaTime; | ||||
|         backupTimer=(backupTimer-ImGui::GetIO().DeltaTime); | ||||
|         if (backupTimer<=0) { | ||||
|           backupTask=std::async(std::launch::async,[this]() -> bool { | ||||
|             if (backupPath==curFileName) { | ||||
|  |  | |||
|  | @ -799,7 +799,7 @@ class FurnaceGUI { | |||
|   double aboutScroll, aboutSin; | ||||
|   float aboutHue; | ||||
| 
 | ||||
|   double backupTimer; | ||||
|   std::atomic<double> backupTimer; | ||||
|   std::future<bool> backupTask; | ||||
|   std::mutex backupLock; | ||||
|   String backupPath; | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 tildearrow
						tildearrow