2012-08-16 18:19:44.069 CT10000-GD[474:707] sqlite的存储路径是/var/mobile/Applications/96C35662-B6F3-468C-80DB-CDE7C8A16A34/Documents/UserBehavior.sqlite
2012-08-16 18:19:44.356 CT10000-GD[474:707] 调用initializeDestroyInfo
CT10000-GD(474,0x3f3b0d98) malloc: *** error for object 0x7330f20a: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug、、上面是报错信息。上面是进程信息。
void FreeAddresses()
{
int i;
for (i=0; i<MAXADDRS; ++i)
{
if (if_names[i] != 0 && if_names[i] != NULL) free(if_names[i]);
if (ip_names[i] != 0 && if_names[i] != NULL) free(ip_names[i]);
if (hw_addrs[i] != 0 && if_names[i] != NULL) free(hw_addrs[i]);
ip_addrs[i] = 0;
}
InitAddresses();
}上面是方法FreeAddresses;
问题:
1.这个报错如何解决?看字面意思是释放的时候已经是空,释放了一个空指针,但我已经判断了,为什么还会报错?
2.看图片,搞java的人都知道,java报错,eclipse会告诉我们是那一行报错,上面的进程图是不是告诉我错误在FreeAddresses方法呢?
3.pointer being freed was not allocated,会在什么情况下还会抛?静待各位帮忙,初学iphone