`
小峰子
  • 浏览: 105336 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

pointer being freed was not allocated

阅读更多
今天在编写一个输入框中文字验证时,出现了以下的错误 JingDuTianXia(3422,0xa0c50540) malloc: *** error for object 0xb1e94: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug Program received signal: “SIGABRT”. 后来追查结果才发现是其中一个属性在一个方法中进行了字符串的赋值 - (int) checkAndSaveIn { self.loginName = @""; self.phone = @""; self.email = @""; self.loginCode = @""; self.secondLoginCode = @""; 而在dealloc方法中进行了内存释放 - (void)dealloc { [self.loginName release]; [self.phone release]; [self.email release]; [self.loginCode release]; [self.secondLoginCode release]; [self.registerTableView release]; [super dealloc]; } 而0xb1e94刚好就是@“”的值,所以是对@“”调用了release方法才导致了这个错误 另外发现类中的属性,在未设置值时,为nil。而UITextField类的text属性,在没有输入时,值也是nil text The text displayed by the text field. @property(nonatomic, copy) NSString *text Discussion This string is nil by default.
分享到:
评论
2 楼 KrisRoofe 2017-05-10  
stackoverflow.com/a/43885754/6521116
1 楼 Ksedaps 2012-07-18  
我也遇到了这个问题。请问你在@property时retain了这些属性了么?

相关推荐

    fake_glx_screen.rar_Freed

    Number of context that are allocated (and not freed).

    Freed4junit案例

    简单易懂的实例全面讲解了 Feed4JUnit 对数据与代码分离的测试支持

    disk-io.rar_Freed

    This function is used to grab the root, and avoid it is freed when we access it. But it doesn t ensure that the tree is not dropped.

    Debugging Malloc Lab: Detecting Memory-Related Errors

    This often does not affect the program immediately, waiting until the corrupted memory is used later (in the case of overwrites) or gradually accumulating allocated but unused blocks. Thus, debugging...

    freed

    已释放1 介绍 释放 软件架构 软件架构说明 安装教程 xxx xxx xxx 使用说明 ...使用Readme_XXX.md来支持不同的语言,例如Readme_en.md,Readme_zh.md ...全称是Gitee最有价值的开源项目,是综合评估出的优秀开源项目 ...

    关于FreeD升级和优化详解

    本文的目的是使新手可以根据此文章的步骤和方法,架设一台专业,高效,安全的FREEBSD出来,并且可以立即投入实际运用。

    Freed.RabbitMQ.rar

    在企业应用系统领域,会面对不同系统之间的通信、集成与整合,尤其当面临异构系统时,这种分布式的调用与通信变得越发重要。其次,系统中一般会有很多对实时性要求不高的但是执行起来比较较耗时的地方,比如发送短信...

    FreeD

    已释放1介绍释放软件架构软件架构说明安装教程xxx xxx xxx使用说明xxx xxx xxx参与贡献叉本仓库新建Feat_xxx分支提交代码新建Pull Request特技使用Readme_XXX.md来支持不同的语言,例如Readme_en.md,Readme_zh.md ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    Do not depend on the symbol being brought in transitively via headers not directly included. One exception is if Foo is used in myfile.cc, it's ok to #include (or forward-declare) Foo in myfile.h, ...

    内存优化(FreeD_3.0.0.3)适用于newifi路由器小云3.0平台

    内存优化(FreeD_3.0.0.3)适用于newifi路由器小云3.0平台。提供多个档位自动清理内存,高效快速的清理垃圾,提升路由器运行速度。安全性和稳定性请自行测试。

    CE中文版-启点CE过NP中文.exe

    Fixed not adding the 0-terminator to strings when the option was set to add it Fixed ultimap hotkeys Fixed ultimap2 filtering Changing pointers in the change address dialog won't set/override global ...

    VclZip pro v3.10.1

    This was due to a problem where it would be freed automatically if there was a problem with the ArchiveStream when trying to open it as a zip file (possibly corrupt). Best practice is that ...

    xidaner#Freed0m#扫描工具整理1

    远程登录文件服务数据库单端口扫描多端口扫描 扫描 80 或 443 端口的 B 类子网扫描一系列端口 扫描 22 到 25 端口的 B 类子网快速扫描排除目标结

    微软内部资料-SQL性能优化2

    To reserve or commit memory and unintentionally not release it when it is no longer being used. A process can leak resources such as process memory, pool memory, user and GDI objects, handles, threads...

    parkinglot:Freed - 众包停车

    获释##aka 停车场 开车很有趣,停车不是。 尤其是随之而来的所有压力。 即使在找到停车位后,我们也必须为添加到停车计时器中的硬币数量... Freed 为您提供了这种信心,它拥有一群细心的用户,可以保护您的汽车并确保

    BobBuilder_app

    I decided against using SortedDictionary for the pages as it was slower than a normal Dictionary and for the purpose of a key value store the sorted-ness was not need and could be handled in other ...

    BIND-LINUX64位包

    names being generated on some platforms. This could cause INSIST failures. (CVE 2014-0591) [RT #35120] Features Changes Add the ability to specify ndots to "nslookup". [RT #34711] Introduce a ...

    EurekaLog_7.5.0.0_Enterprise

    1)..Important: Installation layout was changed. All packages now have version suffix (e.g. EurekaLogCore240.bpl). No files are copied to \bin folder of IDE. Run-time package (EurekaLogCore) is copied ...

    nl_strncmp.rar_The Chain

    The mbuf chain containing the packet will be freed. The mbuf opt, if present, will not be freed.

Global site tag (gtag.js) - Google Analytics