myCursor = nil -> crash

jda jda at his.com
Mon May 2 09:06:35 CDT 2005


Hi Ruslan,

I just found out that something in the latest 2.0.3 builds crashes 
code that has worked for all previous builds.

I create a temporary database and temporary cursor (meaning, neither 
are written to disk):

   refDB = new myDatabase
   myCursor = new VCursor(refDB, "select * from thereferences where 
false", EVCursorLocation.kServerSide, EVLockType.kReadWrite) //make 
an empty cursor
   if myCursor <> nil then //fill cursor with example values
     myCursor.setBlank
     myCursor = fillMyCursorExample(myCursor)

     ...do stuff...

and when it's finished,

myCursor = nil
refDB = nil

This crashes in myCursor = nil (refDB = nil is OK).

If I remove the line, my app crashes when the function is done (and 
an implicit nil occurs). Here's the crash log:

Thread 0 Crashed:
0   Kernel_Carbon_Final.shlb       	0x020eccf0 
_ct__Q23fbl15LogicalFile_ImpFQ23fbl24smart_ptr<Q23fbl6I_File>Ul + 0x80
1   Kernel_Carbon_Final.shlb       	0x02252390 
_ct__Q23fbl9Lock_FileFQ23fbl24smart_ptr<Q23fbl6I_File> + 0x48
2   Kernel_Carbon_Final.shlb       	0x0225224c 
get_LockFile__Q23fbl21TableStorage_SeparateFb + 0xf8
3   Kernel_Carbon_Final.shlb       	0x023b4834 
MakeCreateLock__Q23fbl5TableFv + 0xa0
4   Kernel_Carbon_Final.shlb       	0x023b50f0 
UnlockSet__Q23fbl5TableFQ23fbl21smart_ptr<Q23fbl3Set>Usb + 0xcc
5   Kernel_Carbon_Final.shlb       	0x0224bda4 
UnlockSet__Q23fbl14Table_IndirectFQ23fbl21smart_ptr<Q23fbl3Set>Usb + 
0x160
6   Kernel_Carbon_Final.shlb       	0x021ad60c 
Unlock__Q23fbl11LockManagerFQ23fbl34smart_ptr<Q23fbl15Locking_Command> 
+ 0x90
7   Kernel_Carbon_Final.shlb       	0x021acfbc _dt__Q24vsql6CursorFv + 0x84
8   Kernel_Carbon_Final.shlb       	0x021ad4e0 
Release__Q23fbl59I_Unknown_Impl2<Q24vsql8I_Cursor,Q23fbl17ForeignPlugin_imp>CFv 
+ 0x34
9   Plugin                         	0x004f9294 
Cursor_Destructor__FP16REALobjectStructPv + 0x14c


Any suggestions?

Jon


More information about the Valentina-beta mailing list