2

我正在使用 aQTimer来触发对函数的重复调用,但是它最终因以下错误而崩溃

QEventDispatcherWin32::registerTimer: Failed to create a timer (The current process has used all of its system allowance of handles for Window Manager objects.)
struct HWND__ *__cdecl qt_create_internal_window(const class QEventDispatcherWin32 *): CreateWindow() for QEventDispatcherWin32 internal window failed (The current process has used all of its system allowance of handles for Window Manager objects.)
Qt: INTERNAL ERROR: failed to install GetMessage hook: 1158, The current process has used all of its system allowance of handles for Window Manager objects.

正如此链接中所述,计时器对象占用了这些句柄。有没有办法阻止这种情况?我的程序需要一直运行而无需重新启动且无需用户输入,并且增加系统容限(如某些人所建议的那样)似乎只会延迟崩溃而不是防止崩溃。

定时器代码

QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(mFunc()));
timer->start(15000);

计时器不会在其他任何地方重新创建。

4

0 回答 0