xojo.core.date crashes when used in close window event

Hi I trying to log the time for my app.

I send a date.now into a property in the open window event.

When doing the close window, method is called, and inside this method I’m trying to use the property stored for startup date/time.

But each time I try to just use on tiny bit of the property i.e. dateStored.year, my app crashes… If I test with just 2015 as the year it works…

my code:
Dim d3 As New Date(DateStored.year, 1, 13, 21, 0,0,0, TimeZone.Current)

And the property is setup like:
xojo.core.date (type)

Application Specific Information:
objc_msgSend() selector name: timeIntervalSinceReferenceDate
Performing @selector(menuItemAction:) from sender NSMenuItem 0x6208c60

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x9097d1c7 objc_msgSend_fpret + 23
1 com.apple.CoreFoundation 0x9a0a32d2 -[_NSCopyOnWriteCalendarWrapper components:fromDate:] + 162
2 com.xojo.XojoFramework 0x0043002c 0x2ae000 + 1581100
3 com.xojo.XojoFramework 0x002b373b Date_Year + 43
4 no.hgtsoftware.reedproject 0x00006ad2 xojo.Core.Date.Year.Get%i4%o<xojo.Core.Date>i4 + 50
5 no.hgtsoftware.reedproject 0x0021bc6d wMain.wMain.AddToLogg%%o<wMain.wMain>ss + 1071
6 no.hgtsoftware.reedproject 0x0021b3af wMain.wMain.Event_Close%%o<wMain.wMain> + 78
7 com.xojo.XojoFramework 0x0035813f 0x2ae000 + 696639
8 com.xojo.XojoFramework 0x00357efd 0x2ae000 + 696061
9 com.xojo.XojoFramework 0x00359a87 0x2ae000 + 703111
10 com.xojo.XojoFramework 0x0034e17c 0x2ae000 + 655740
11 com.xojo.XojoFramework 0x0043c4e9 0x2ae000 + 1631465
12 com.xojo.XojoFramework 0x0034e03b 0x2ae000 + 655419
13 com.xojo.XojoFramework 0x0034e1b5 0x2ae000 + 655797
14 com.xojo.XojoFramework 0x004214f9 QuitMenuAction + 67
15 no.hgtsoftware.reedproject 0x000310d8 QuitMenuItem.Event_Action%b%o + 42
16 com.xojo.XojoFramework 0x003868db 0x2ae000 + 887003
17 com.xojo.XojoFramework 0x002cd93e 0x2ae000 + 129342
18 com.xojo.XojoFramework 0x002cddfa 0x2ae000 + 130554
19 libobjc.A.dylib 0x90984853 -[NSObject performSelector:withObject:] + 70
20 com.apple.AppKit 0x945a11a8 __36-[NSApplication sendAction:to:from:]_block_invoke + 51
21 libsystem_trace.dylib 0x9787fc03 _os_activity_initiate + 89
22 com.apple.AppKit 0x94414851 -[NSApplication sendAction:to:from:] + 548
23 com.apple.AppKit 0x9443082d -[NSMenuItem _corePerformAction] + 479
24 com.apple.AppKit 0x94430509 -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 162
25 com.apple.AppKit 0x9442fb94 -[NSMenu _performActionWithHighlightingForItemAtIndex:sendAccessibilityNotification:] + 79
26 com.apple.AppKit 0x9442fb3c -[NSMenu _performActionWithHighlightingForItemAtIndex:] + 48
27 com.apple.AppKit 0x947a63a9 __31-[NSMenu performKeyEquivalent:]_block_invoke + 43
28 libsystem_trace.dylib 0x9787fc03 _os_activity_initiate + 89
29 com.apple.AppKit 0x9442f46d -[NSMenu performKeyEquivalent:] + 380
30 com.apple.AppKit 0x9442b6c3 -[NSApplication _handleKeyEquivalent:] + 918
31 com.apple.AppKit 0x943a69be -[NSApplication sendEvent:] + 4574
32 com.xojo.XojoFramework 0x002df813 0x2ae000 + 202771
33 com.xojo.XojoFramework 0x002df854 0x2ae000 + 202836
34 no.hgtsoftware.reedproject 0x00002dc9 Delegate.Invoke%% + 34
35 no.hgtsoftware.reedproject 0x000577be Application._CallFunctionWithExceptionHandling%%op + 248
36 com.xojo.XojoFramework 0x00402cfa 0x2ae000 + 1395962
37 com.xojo.XojoFramework 0x002df782 0x2ae000 + 202626
38 com.apple.AppKit 0x94220e0c -[NSApplication run] + 1003
39 com.xojo.XojoFramework 0x00402d77 0x2ae000 + 1396087
40 com.xojo.XojoFramework 0x0040132f RuntimeRun + 49
41 no.hgtsoftware.reedproject 0x000e1890 REALbasic._RuntimeRun + 34
42 no.hgtsoftware.reedproject 0x00002cb5 _Main + 257
43 no.hgtsoftware.reedproject 0x00002650 main + 36
44 no.hgtsoftware.reedproject 0x0022e9d1 start + 53

Show us the code for AddToLogg.

Using Xojo.Core

Dim d As Date = Date.Now
Dim FullHva as string

mTblLogg.SetBlank()
mTblLogg.Field(“ID”).SetString(str(app.gUser))

if hva.left(10) = “Logged out” then
'Dim d3 As New Date(DateStored.Year, 1, 13, 21, 0,0,0, TimeZone.Current)

FullHva = hva   //'+ str(interval.days)+"d"+ str(interval.hours)+"h "+ str(interval.Minutes)+"m "+ str(interval.Seconds)+"s"
mTblLogg.Field("Hva").SetString(FullHva)

else
mTblLogg.Field(“Hva”).SetString(Hva)
end if

mTblLogg.Field(“Tidspunkt”).setString(d.ToText)

call mTblLogg.AddRecord()

Please file a bug report with an example project.

Please re-open the case in feedback. The solution did not cover the problem.