浏览代码

Fix ScopeGuard move behavior

nordsoft 2 年之前
父节点
当前提交
91ef7cbb4f
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      lib/ScopeGuard.h

+ 2 - 1
lib/ScopeGuard.h

@@ -37,7 +37,8 @@ namespace vstd
 		{}
 		{}
 		~ScopeGuard()
 		~ScopeGuard()
 		{
 		{
-			f();
+			if(fire)
+				f();
 		}
 		}
 	};
 	};