大佬教程收集整理的这篇文章主要介绍了在finalize / close期间,sqlite3_column_text返回的数据被破坏,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
// rc not handled in this abbreviated code sqlite3 *db; sqlite3_stmt *stmt; char * sql; const char * tail; int rc; char * dbname = "C:\\db\\myblobs.db"; int myIndex = 0; char * myLOCATIOn1; String myLOCATIOn2; rc = sqlite3_open(dbName,@R_165_4616@; sql = "SELECT LOCATIOn FROM blobs WHERE key = ?"; rc = sqlite3_prepare(db,sql,strlen(sql),&stmt,&tail); sqlite3_bind_int(stmt,1,myIndeX); rc = sqlite3_step(stmt); myLOCATIOn1 = (char*)sqlite3_column_text(stmt,0); myLOCATIOn2 = (char*)sqlite3_column_text(stmt,0); // can process myLOCATIOn1 & myLOCATIOn2 fine here sqlite3_finalize(stmt); // data myLOCATIOn1 points to get corrupted sqlite3_close(db); // data myLOCATIOn2 points to gets further corrupted
问题与myLOCATIOn1有关.它指向的数据很好,直到它到达sqlite3_finalize和sqlite3_close语句.然而,myLOCATIOn2保持不变.所以不确定这里发生了什么.执行sqlite3_close(db)后,myLOCATIOn1在Visual studio 2010中被标识为“Bad Ptr”.
任何帮助最受赞赏.
以上是大佬教程为你收集整理的在finalize / close期间,sqlite3_column_text返回的数据被破坏全部内容,希望文章能够帮你解决在finalize / close期间,sqlite3_column_text返回的数据被破坏所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。