当前位置: 代码迷 >> Symbian >> 5800 中反复创建CBrCtlInterface,会出现kern-exec 3异常!怎么解决
  详细解决方案

5800 中反复创建CBrCtlInterface,会出现kern-exec 3异常!怎么解决

热度:3824   发布时间:2013-02-26 00:00:00.0
5800 中反复创建CBrCtlInterface,会出现kern-exec 3错误!如何解决?
如果在一个view的container中创建了一个CBrCtlInterface,切换到另一个view时删除这个CBrCtlInterface,再次切换回这个view时就会报kern-exec 3错误!

------解决方案--------------------------------------------------------
应该可以反复创建。试试SDK附带的例子:
C:\S60\devices\S60_5th_Edition_SDK_v1.0\S60CppExamples\BrCtlSampleApp

此外,看看是不是这个问题:
http://wiki.forum.nokia.com/index.php/KIS000879_-_Deleting_an_object_of_CBrCtlInterface_may_cause_a_panic
------解决方案--------------------------------------------------------
Deleting an object of CBrCtlInterface when the controller is still loading a Web page can cause a Kern-Exec 3 Panic. This known issue occurs in some old S60 3rd Edition devices using the old Browser Engine (Services).

The only way to avoid the panic is to not delete the CBrCtlInterface object before the Web page has been fully loaded. If the Web page is loading when user wants to quit, open an empty Web page calling the CBrCtlInterface::LoadUrl() function and wait until the empty page has been loaded and then call AppUi::Exit(). This is done because loading an empty page is more likely faster than waiting for the current Web page to be loaded.

The MBrCtlLoadEventObserver::HandleBrowserLoadEventL function can be used to observe the state changes of the Web page loading task. For instance, the function can be used to observe when the page has been fully loaded and application closing is possible.



楼上正解,我也遇到过。。。
------解决方案--------------------------------------------------------
不难理解,对象被删除,还要让对象做事当然会Panic.
------解决方案--------------------------------------------------------
刚才运行一遍SDK附带的例子: 
C:\S60\devices\S60_5th_Edition_SDK_v1.0\S60CppExamples\BrCtlSampleApp 
其中有删除/新建操作,但没有碰到异常。
------解决方案--------------------------------------------------------
刚才运行5th SDK附带的例子: 
C:\S60\devices\S60_5th_Edition_SDK_v1.0\S60CppExamples\BrCtlSampleApp 
其中有删除/新建操作,未见异常。
------解决方案--------------------------------------------------------
指针在使用之前最好是判空,根据逻辑操作。。
而且delete 完了之后要置空。要不就是野指针了。。。
------解决方案--------------------------------------------------------
等LoadUrlL完完全全完成后,再删除iBrCtlInterface,还会panic吗?
------解决方案--------------------------------------------------------
可能其它指针问题.
------解决方案--------------------------------------------------------
刚刚在3rd的手机上试了3rd\S60Ex\BrCtlSampleApp,没有什么异常啊!
------解决方案--------------------------------------------------------
抱歉,还没有5th的手机~
------解决方案--------------------------------------------------------
BrCtlSampleApp例子中的相关重建代码如下:
C/C++ code
voidCBrCtlSampleAppContainer::CreateBrowserControlWithObserversL(TUint aCapabilities)    {    if (iBrCtlCapabilities != aCapabilities)        {        delete iBrCtlInterface;        iBrCtlInterface = NULL;        }    iBrCtlCapabilities = aCapabilities;    if (iBrCtlInterface == NULL)        {        TRect rect(Position(), Size());        iBrCtlInterface = CreateBrowserControlL( this,            rect,            iBrCtlCapabilities,            TBrCtlDefs::ECommandIdBase,            iBrCtlSampleAppSoftkeysObserver,            iBrCtlSampleAppLinkResolver,            iBrCtlSampleAppSpecialLoadObserver,            iBrCtlSampleAppLayoutObserver);        iBrCtlInterface->AddLoadEventObserverL(iBrCtlSampleAppLoadEventObserver);        iBrCtlInterface->AddStateChangeObserverL(iBrCtlSampleAppStateChangeObserver);        }    }
------解决方案--------------------------------------------------------
在5th sdk help看看在5版里对CBrCtlInterface使用有什么要求.
------解决方案--------------------------------------------------------
  相关解决方案