询问者
c++的游戏,在低配手机上高频率触摸出现概率性崩溃,请帮帮我

问题
-
大家好,我遇到一个比较棘手的问题,c++开发的游戏,如果一步一步点击运行没有问题,但快速不停点击时,在520机型上会随机崩溃;请有经验的前辈给予指引,谢谢。
可追踪到的游戏内代码是主循环内的
CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
堆栈信息:
Msvcr110d.dll!_invoke_watson(const wchar_t * pszExpression, const wchar_t * pszFunction, const wchar_t * pszFile, unsigned int nLine, unsigned int pReserved) Line 131 C++
Vccorlib110d.dll!__abi_FailFast() Line 18 C++
client.exe!?__abi_Windows_Foundation_?$TypedEventHandler@P$AAVCoreWindow@Core@UI@Windows@@P$AAVPointerEventArgs@234@___abi_IDelegate____abi_Invoke@?Q__abi_IDelegate@?$TypedEventHandler@P$AAVCoreWindow@Core@UI@Windows@@P$AAVPointerEventArgs@234@@Foundation@Windows@@234@U$AAAJP$AAVCoreWindow@Core@UI@4@P$AAVPointerEventArgs@674@@Z(Windows::UI::Core::CoreWindow ^ __param0, Windows::UI::Core::PointerEventArgs ^ __param1) C++
Msvcr110d.dll!_CallSettingFrame() Line 3721 Unknown
Msvcr110d.dll!__CxxCallCatchBlock(_EXCEPTION_RECORD * pExcept) Line 1264 C++
NTDLL.DLL!RcConsolidateFrames() Unknown
client.exe!?__abi_Windows_Foundation_?$TypedEventHandler@P$AAVCoreWindow@Core@UI@Windows@@P$AAVPointerEventArgs@234@___abi_IDelegate____abi_Invoke@?Q__abi_IDelegate@?$TypedEventHandler@P$AAVCoreWindow@Core@UI@Windows@@P$AAVPointerEventArgs@234@@Foundation@Windows@@234@U$AAAJP$AAVCoreWindow@Core@UI@4@P$AAVPointerEventArgs@674@@Z(Windows::UI::Core::CoreWindow ^ __param0, Windows::UI::Core::PointerEventArgs ^ __param1) C++
AppModelCore.dll!Microsoft::WRL::EventSource<struct Windows::Foundation::ITypedEventHandler<class Windows::UI::Core::CoreWindow *,class Windows::UI::Core::PointerEventArgs *> >::InvokeAll<class Windows::UI::Core::CoreWindow *,struct Windows::UI::Core::IPointerEventArgs *>(class Windows::UI::Core::CoreWindow *,struct Windows::UI::Core::IPointerEventArgs *) Unknown
AppModelCore.dll!Windows::UI::Core::CoreWindow::SendReleasedEvent(class Windows::UI::Input::PointerPoint *) Unknown
AppModelCore.dll!Windows::UI::Core::CoreWindow::HandleTouchEvent(struct TouchInfo const *,struct TouchContact const *) Unknown
AppModelCore.dll!Windows::UI::Core::CoreWindow::ProcessTouchEvent(struct TouchInfo const *) Unknown
AppModelCore.dll!Windows::UI::Core::CDispatcher::ProcessInputItem(void) Unknown
AppModelCore.dll!Windows::UI::Core::CDispatcher::RunProcessInvokeItemMsgGroup(void) Unknown
CoreUI.dll!Microsoft__CoreUI__DispatchGroupHandler$ExportThunk(class System::Delegate *) Unknown
CoreUI.dll!Microsoft::CoreUI::Dispatch::EventLoop::Run(struct Microsoft::CoreUI::Dispatch::RunMode) Unknown
CoreUI.dll!Microsoft::CoreUI::IExportMessageLoopExtensions$X__ExportAdapter::Run(struct Microsoft::CoreUI::Dispatch::RunMode) Unknown
AppModelCore.dll!Windows::UI::Core::CDispatcher::ProcessEvents(enum Windows::UI::Core::CoreProcessEventsOption) Unknown
client.exe!Windows::UI::Core::ICoreDispatcher::ProcessEvents(Windows::UI::Core::CoreProcessEventsOption __param0) C++//此处为可追踪的源码
client.exe!cocos2d::CCFrameworkView::[Windows::ApplicationModel::Core::IFrameworkView]::Run() Line 212 C++
client.exe!cocos2d::CCFrameworkView::[Windows::ApplicationModel::Core::IFrameworkView]::__abi_Windows_ApplicationModel_Core_IFrameworkView____abi_Run() C++
AppModelCore.dll!Windows::ApplicationModel::Core::CoreApplicationView::Run(void) Unknown
AppModelCore.dll!<lambda>(void)() Unknown
AppModelCore.dll!ASTAThread() Unknown
NTDLL.DLL!RtlUserThreadStart() Unknown
- 已编辑 __navy__ 2014年10月13日 7:58
全部回复
-
你好 _navy_
可否尝试更改一下ProcessEvents的参数,目前的CoreProcessEventsOption::ProcessAllIfPresent看样子是让所有的事件都在某个队列里面等待(貌似这个参数是在做DX开发时候才用到的),个人猜测有可能本身机子处理的慢,等待的多了就造成程序崩溃?试试看能不能把值改成其他几个: http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.core.coreprocesseventsoption或者尝试一下这个办法:
#include <agile.h> Platform::Agile<CoreWindow> m_window; m_window->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
不过你提供的堆栈信息似乎没有提到什么特别的信息。
--James
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.- 已建议为答案 Leo (Apple) YangModerator 2014年10月23日 6:50