HI Folks,
I have one user who is getting fairly reliable crashes while saving data in the app. This is the stack trace from the crash:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.xojo.XojoFramework 0x00ef5c33 RuntimeObjectIsa + 139
1 com.xojo.XojoFramework 0x00e7ea88 0xd9f000 + 916104
2 com.xojo.XojoFramework 0x00f28a61 VarType + 305
3 com.xojo.XojoFramework 0x00f23094 0xd9f000 + 1589396
4 com.xojo.XojoFramework 0x00f22d5a VariantCompare + 30
5 com.xojo.XojoFramework 0x00f22d2f VariantEqual + 24
6 com.xojo.XojoFramework 0x00e61b07 0xd9f000 + 797447
7 com.xojo.XojoFramework 0x00e620f9 0xd9f000 + 798969
8 com.xojo.XojoFramework 0x00e6257c dictionaryValueSetter + 91
9 com.myapp.thingy 0x0002bb66 Dictionary.=Value%%ovv + 54
What Im doing at this point is updating a bunch of dictionary values before writing them out to a file. IIm just setting a dictionary value with a string as the key and a string as the value. The function takes the key as a string and the value as an integer, but converts the integer to a string before saving it in the dictionary. A little goofing around first to make sure the string has an encoding before trying to save it and I can see a potential problem there as I shouldnt be converting encoding if the encoding is nil, I should be defining the encoding. But Im not sure I can blame the crash in RuntimeObjectIsa on that? The last line values is a dictionary in scope for the object.
function setIntegerValue( key as string, value as integer)
dim ThisValue, ThisKey as string
if key.Encoding = nil or key.Encoding <> Encodings.utf8 then
ThisKey = ConvertEncoding( key, Encodings.UTF8)
else
ThisKey = key
end if
ThisValue = str( value)
values.Value( ThisKey) = ThisValue
Any ideas on why that might sometimes result in a crash?