Ogre4J 使用中错误总结

1 篇文章 0 订阅

1、EXCEPTION_ACCESS_VIOLATION

#
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x69f4b686, pid=400, tid=5828
#
# Java VM: Java HotSpot(TM) Client VM (11.3-b02 mixed mode windows-x86)
# Problematic frame:
# C  [atioglxx.dll+0xf1b686]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

 

这是指你去碰了不该碰的东西,越界了,也就是说在一个非UI线程去操作了UI线程。因为,SWT 在底层设计时不允许其他的线程访问 UI 线程,这样你就犯错了,所以在使用UI线程时要加上一句

swtShell.getDisplay().asyncExec(new Runnable() { 
	public void run() {
		updateAssets((Map<String, MonitorObject>) peoples);						
	}
});

 

2、java.util.ConcurrentModificationException

工作中碰到个ConcurrentModificationException。代码如下:
List list = ...;
for(Iterator iter = list.iterator(); iter.hasNext();) {
    Object obj = iter.next();
    ...
    if(***) {
        list.remove(obj);
    }
}
在执行了remove方法之后,再去执行循环,iter.next()的时候,报java.util.ConcurrentModificationException(当然,如果remove的是最后一条,就不会再去执行next()操作了)

总而言之,是你的list在你循环的时候,被你修改了,所以才报错。

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值