Difference atexit() and at_quick_exit()
Difference atexit() and at_quick_exit()
atexit()
和at_quick_exit()
有什么区别?
我们在 atexit(( 注册的每个函数也必须在 at_quick_exit(( 注册吗?
例如,凤凰-辛格尔顿自定义函数或其他函数。
好吧,从at_quick_exit:
Registers the function pointed to by func to be called on quick program termination (via std::quick_exit).
...
The registered functions will not be called on normal program termination. If a function need to be called in that case, std::atexit must be used.
在atexit()
上注册的函数在exit()
调用。向at_quick_exit()
注册的函数在quick_exit()
上调用。
另一个区别是at_quick_exit()
从 C++11 开始可用,而在 C 中不可用。
相关文章:
- Qt Quick-如何仅从c++代码与qml属性交互
- 使用的未初始化局部变量'Quick'
- Qt Quick,如何更改 Ui 源代码?
- 我如何测试代码没有调用 exit()
- exit(0) 和 raise(SIGTERM) 有什么区别?
- "Program ended with exit code: 0"出现在我的输出的开头?
- Qt Quick - 如何在 qml 接口中使用继承自 QQuickPaintedItem 的 c++ 类?
- exit(EXITT_FAILURE)在c和c++中是如何工作的
- 在C++中使用exit()退出程序有问题吗
- 禁用优化后,quick-bench.com 基准测试要快得多
- 什么时候在 c++ 中使用 exit() 与异常更好?
- "ndk-build finish with non-zero exit value 2" 在编译文本仙女项目时
- 当可以返回错误/异常时,从库中终止调用程序(例如,调用exit())是否总是错误的?
- 我在C++中收到错误" [Error] ld returned 1 exit status".帮我解决这个问题
- 为什么错误"permission denied","id returned 1 exit status"仅在 IM 使用 C++ 中的头文件 fstream 时才出现
- 为什么"quick sorting"算法的这两种变体在性能上差异如此之大?
- Qt Quick + CMake + 自定义 QObject 导致对"vtable"的未定义引用
- 通过CMake在没有Qt Creator的情况下构建Qt5 Quick项目
- 如何拦截Qt Quick qml事件
- 析构函数中的互斥锁C++在 Python 中调用 exit() 时会导致异常