I have an issue when I subclass a type which bind an obj-C type. In some cases, it fails at construction time.
I can reproduce this right now with the cocos2d bindings and CCSprite. Here's my subclass
public class MySprite : CCSprite
{
public MySprite (string filename) : base (filename)
{}
}
When I instantiate it, it fails:
Stacktrace:
at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (intptr,intptr,intptr) <IL 0x00025, 0xffffffff>
at MonoTouch.Cocos2D.CCSprite.set_Texture (MonoTouch.Cocos2D.CCTexture2D) <IL 0x00048, 0x00137>
at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <IL 0x00052, 0xffffffff>
at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_IntPtr (intptr,intptr,intptr) <IL 0x00027, 0xffffffff>
at MonoTouch.Cocos2D.CCSprite..ctor (string) <IL 0x00072, 0x001a3>
at Demo.MySprite..ctor (string) <IL 0x00002, 0x00027>
[...]
Native stacktrace:
0 Demo 0x00115b5c mono_handle_native_sigsegv + 284
1 Demo 0x00089c38 mono_sigsegv_signal_handler + 248
2 libsystem_c.dylib 0x962af86b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 Demo 0x0003b9d2 -[CCSprite setOpacityModifyRGB:] + 47
5 Demo 0x0003c18c -[CCSprite updateBlendFunc] + 267
6 Demo 0x0003c37c -[CCSprite setTexture:] + 488
7 ??? 0x11cadc94 0x0 + 298507412
8 ??? 0x11cada78 0x0 + 298506872
9 ??? 0x11cadbf6 0x0 + 298507254
10 Demo 0x0008dff2 mono_jit_runtime_invoke + 722
11 Demo 0x001f0b7e mono_runtime_invoke + 126
12 Demo 0x00293736 monotouch_trampoline + 3686
13 Demo 0x0003909e -[CCSprite initWithTexture:rect:rotated:] + 614
14 Demo 0x0003914d -[CCSprite initWithTexture:rect:] + 70
15 Demo 0x0003934c -[CCSprite initWithFile:] + 275
16 ??? 0x11cad803 0x0 + 298506243
17 ??? 0x11cad6ec 0x0 + 298505964
18 ??? 0x11cace30 0x0 + 298503728
19 ??? 0x11cac958 0x0 + 298502488
20 ??? 0x11ca7f04 0x0 + 298483460
21 ??? 0x0d7f7258 0x0 + 226456152
22 ??? 0x0d7f0a7c 0x0 + 226429564
23 ??? 0x0d7f0dc5 0x0 + 226430405
24 Demo 0x0008dff2 mono_jit_runtime_invoke + 722
25 Demo 0x001f0b7e mono_runtime_invoke + 126
26 Demo 0x00293736 monotouch_trampoline + 3686
27 UIKit 0x016c59d6 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1292
28 UIKit 0x016c68a6 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 508
29 UIKit 0x016d5743 -[UIApplication handleEvent:withNewEvent:] + 1027
30 UIKit 0x016d61f8 -[UIApplication sendEvent:] + 68
31 UIKit 0x016c9aa9 _UIApplicationHandleEvent + 8196
32 GraphicsServices 0x042bafa9 PurpleEventCallback + 1274
33 CoreFoundation 0x037231c5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
34 CoreFoundation 0x03688022 __CFRunLoopDoSource1 + 146
35 CoreFoundation 0x0368690a __CFRunLoopRun + 2218
36 CoreFoundation 0x03685db4 CFRunLoopRunSpecific + 212
37 CoreFoundation 0x03685ccb CFRunLoopRunInMode + 123
38 UIKit 0x016c62a7 -[UIApplication _run] + 576
39 UIKit 0x016c7a9b UIApplicationMain + 1175
40 ??? 0x0d7ebbc5 0x0 + 226409413
41 ??? 0x0d7e5020 0x0 + 226381856
42 ??? 0x0d7e4390 0x0 + 226378640
43 ??? 0x0d7e44e6 0x0 + 226378982
44 Demo 0x0008dff2 mono_jit_runtime_invoke + 722
45 Demo 0x001f0b7e mono_runtime_invoke + 126
46 Demo 0x001f4d74 mono_runtime_exec_main + 420
47 Demo 0x001fa165 mono_runtime_run_main + 725
48 Demo 0x000eb4d5 mono_jit_exec + 149
49 Demo 0x002889f5 main + 2005
50 Demo 0x00086f81 start + 53
What worries me is that I have similar code working in a different application.
And to be complete, if I override the Texture property to proxy to base, it doesn't crash anymore, but doesn't display anything so I suspect the native object is in bad shape.
I also tried [Register]ing the class, and adding the default constructor overrides.
[UPDATE] I compared this project with the other one that was working. In fact, both are working on device, and both fails the same way in the simulator.
[UPDATE2] here's a sample triggering the behaviour: https://github.com/StephaneDelcroix/mt-subclassbug The Cocos2D.dll is a fresh one generated this morning from monotouch-bindings master
Answering my own question. The bug was not in the bindings definition, nor in the tools used to generate them, but in the 2.1rc0 version of cocos2d. upgrading to 2.1rc0a fixed it.
This then triggers a new issue, but that one could be traced down to the bindings definition, and is fixed here https://github.com/mono/monotouch-bindings/pull/97
Related
Hey StackOverflow detectives.
I've been pulling my hair out for a few months trying to figure out the crashes which happen at a line never exists.
In the crash log below, CustomClass.swift does exist but the line 25 doesn't.
What would be the true reason for this crash?
Hint: we run heavy processing and allocate a lot of memory (about 700MB) in the background that was written in c++, which is in OUR_CUSTOM_FRAMEWORK below.
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x00000001934c6df0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001933e6930 pthread_kill + 228 (pthread.c:1458)
2 libsystem_c.dylib 0x0000000193374ba4 abort + 104 (abort.c:110)
3 libsystem_malloc.dylib 0x00000001933d7fdc malloc_vreport + 564 (malloc_printf.c:183)
4 libsystem_malloc.dylib 0x00000001933d81a4 malloc_report + 64 (malloc_printf.c:192)
5 libsystem_malloc.dylib 0x00000001933cbd1c free + 436 (malloc.c:1733)
6 [OUR_CUSTOM_FRAMEWORK] 0x000000010324ccf8 0x1031a4000 + 691448
7 libsystem_c.dylib 0x0000000193355164 __cxa_finalize_ranges + 416 (atexit.c:284)
8 libsystem_c.dylib 0x00000001933554a0 exit + 28 (exit.c:81)
9 UIKitCore 0x000000019782eb88 -[UIApplication _terminateWithStatus:] + 508 (UIApplication.m:6735)
10 UIKitCore 0x0000000196f97718 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 128 (_UISceneLifecycleMultiplexer.m:765)
11 UIKitCore 0x0000000196f9737c -[_UISceneLifecycleMultiplexer forceExitWithTransitionContext:scene:] + 220 (_UISceneLifecycleMultiplexer.m:418)
12 UIKitCore 0x0000000197824ac4 -[UIApplication workspaceShouldExit:withTransitionContext:] + 216 (UIApplication.m:3725)
13 FrontBoardServices 0x000000019893bcf8 -[FBSUIApplicationWorkspaceShim workspaceShouldExit:withTransitionContext:] + 88 (FBSUIApplicationWorkspace.m:144)
14 FrontBoardServices 0x0000000198968d68 __83-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:withAcknowledgement:]_block_invoke_2 + 80 (FBSWorkspaceScenesClient.m:281)
15 FrontBoardServices 0x000000019894debc -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 240 (FBSWorkspace.m:357)
16 FrontBoardServices 0x0000000198968cf4 __83-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:withAcknowledgement:]_block_invoke + 140 (FBSWorkspaceScenesClient.m:278)
17 libdispatch.dylib 0x000000019338033c _dispatch_client_callout + 20 (object.m:495)
18 libdispatch.dylib 0x00000001933830d4 _dispatch_block_invoke_direct + 264 (queue.c:466)
19 FrontBoardServices 0x000000019898f6c4 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 48 (FBSSerialQueue.m:173)
20 FrontBoardServices 0x000000019898f370 -[FBSSerialQueue _queue_performNextIfPossible] + 432 (FBSSerialQueue.m:216)
21 FrontBoardServices 0x000000019898f8dc -[FBSSerialQueue _performNextFromRunLoopSource] + 32 (FBSSerialQueue.m:247)
22 CoreFoundation 0x000000019365baf4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1922)
23 CoreFoundation 0x000000019365ba48 __CFRunLoopDoSource0 + 84 (CFRunLoop.c:1956)
24 CoreFoundation 0x000000019365b198 __CFRunLoopDoSources0 + 196 (CFRunLoop.c:1992)
25 CoreFoundation 0x0000000193655f38 __CFRunLoopRun + 796 (CFRunLoop.c:2882)
26 CoreFoundation 0x00000001936558f4 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)
27 GraphicsServices 0x000000019da6c604 GSEventRunModal + 164 (GSEvent.c:2246)
28 UIKitCore 0x0000000197829358 UIApplicationMain + 1944 (UIApplication.m:4823)
29 [APPNAME] 0x0000000100d45128 main + 68 (CustomClass.swift:25)
30 libdyld.dylib 0x00000001934d12dc start + 4
I am getting this aforementioned error. I've applied the following solution from this thread and that one with no avail. Is there some module or class I'm suppose to import? Any help will be appreciated.
Github: https://github.com/joeavargas/BMI-Calc/tree/master/BMI%20Calc
Swift 3 / Xcode 8.3.3
error
Error from Console:
2017-07-06 08:20:28.252 BMI Calc[61662:12276419] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key mass.'
* First throw call stack:
(
0 CoreFoundation 0x000000010df6eb0b exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010b2fe141 objc_exception_throw + 48
2 CoreFoundation 0x000000010df6ea59 -[NSException raise] + 9
3 Foundation 0x000000010ae1400b -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
4 UIKit 0x000000010b96b994 -[UIViewController setValue:forKey:] + 87
5 UIKit 0x000000010bbd8a09 -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x000000010df14e8d -[NSArray makeObjectsPerformSelector:] + 269
7 UIKit 0x000000010bbd73bf -[UINib instantiateWithOwner:options:] + 1856
8 UIKit 0x000000010b971fc3 -[UIViewController _loadViewFromNibNamed:bundle:] + 381
9 UIKit 0x000000010b9728d9 -[UIViewController loadView] + 177
10 UIKit 0x000000010b972c0a -[UIViewController loadViewIfRequired] + 195
11 UIKit 0x000000010b97345a -[UIViewController view] + 27
12 UIKit 0x000000010b83b98a -[UIWindow addRootViewControllerViewIfPossible] + 65
13 UIKit 0x000000010b83c070 -[UIWindow _setHidden:forced:] + 294
14 UIKit 0x000000010b84eebe -[UIWindow makeKeyAndVisible] + 42
15 UIKit 0x000000010b7c837f -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4346
16 UIKit 0x000000010b7ce5e4 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1709
17 UIKit 0x000000010b7cb7f3 -[UIApplication workspaceDidEndTransaction:] + 182
18 FrontBoardServices 0x000000010f67e5f6 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 24
19 FrontBoardServices 0x000000010f67e46d -[FBSSerialQueue _performNext] + 186
20 FrontBoardServices 0x000000010f67e7f6 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
21 CoreFoundation 0x000000010df14c01 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
22 CoreFoundation 0x000000010defa0cf __CFRunLoopDoSources0 + 527
23 CoreFoundation 0x000000010def95ff __CFRunLoopRun + 911
24 CoreFoundation 0x000000010def9016 CFRunLoopRunSpecific + 406
25 UIKit 0x000000010b7ca08f -[UIApplication _run] + 468
26 UIKit 0x000000010b7d0134 UIApplicationMain + 159
27 BMI Calc 0x000000010ad246f7 main + 55
28 libdyld.dylib 0x000000010ef0e65d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
The most significant information is
this class is not key value coding-compliant for the key mass.
Select the storyboard or xib file in the project navigator
Select the view controller
Open Connection Inspector (⌥⌘6)
Remove the connection to mass
I was trying to resize an image in a function using opencv that is called within a continous loop for socket transmissions and I obtained this error
2017-04-10 15:46:47.200 python[1541:16193] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff8ce2b37b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fffa1c1f48d objc_exception_throw + 48
2 CoreFoundation 0x00007fff8cd44b5c -[__NSArrayM objectAtIndex:] + 204
3 libopencv_highgui.2.4.dylib 0x0000000114d31280 _ZN13CvCaptureFileC2EPKc + 350
4 libopencv_highgui.2.4.dylib 0x0000000114d2fcf2 _Z32cvCreateFileCapture_AVFoundationPKc + 34
5 libopencv_highgui.2.4.dylib 0x0000000114d237ee cvCreateFileCapture + 14
6 libopencv_highgui.2.4.dylib 0x0000000114d23a9e _ZN2cv12VideoCapture4openERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 64
7 libopencv_highgui.2.4.dylib 0x0000000114d238fe _ZN2cv12VideoCaptureC2ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE + 42
8 cv2.so 0x00000001144ccbce _ZL34pyopencv_VideoCapture_VideoCaptureP7_objectS0_S0_ + 275
9 libpython2.7.dylib 0x000000010e6c61bd PyEval_EvalFrameEx + 30141
10 libpython2.7.dylib 0x000000010e6be8f2 PyEval_EvalCodeEx + 1538
11 libpython2.7.dylib 0x000000010e64943c function_call + 364
12 libpython2.7.dylib 0x000000010e623333 PyObject_Call + 99
13 libpython2.7.dylib 0x000000010e6305b6 instancemethod_call + 182
14 libpython2.7.dylib 0x000000010e623333 PyObject_Call + 99
15 libpython2.7.dylib 0x000000010e6ca80d PyEval_CallObjectWithKeywords + 93
16 libpython2.7.dylib 0x000000010e62e5c6 PyInstance_New + 134
17 libpython2.7.dylib 0x000000010e623333 PyObject_Call + 99
18 libpython2.7.dylib 0x000000010e6c5e8f PyEval_EvalFrameEx + 29327
19 libpython2.7.dylib 0x000000010e6cb0b2 fast_function + 274
20 libpython2.7.dylib 0x000000010e6c5db3 PyEval_EvalFrameEx + 29107
21 libpython2.7.dylib 0x000000010e6cb0b2 fast_function + 274
22 libpython2.7.dylib 0x000000010e6c5db3 PyEval_EvalFrameEx + 29107
23 libpython2.7.dylib 0x000000010e6be8f2 PyEval_EvalCodeEx + 1538
24 libpython2.7.dylib 0x000000010e6be2e6 PyEval_EvalCode + 54
25 libpython2.7.dylib 0x000000010e6ed254 PyRun_FileExFlags + 164
26 libpython2.7.dylib 0x000000010e6ecdd1 PyRun_SimpleFileExFlags + 769
27 libpython2.7.dylib 0x000000010e702a12 Py_Main + 3154
28 python 0x000000010e610f24 start + 52
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6
The code that I used that I assume generates this error is
import numpy as np
import cv2
class video_read():
def __init__(self, filename):
self.cap = cv2.VideoCapture(filename)
def read_frames(self):
frame = self.cap.read()[1]
image = cv2.imencode('.png', frame)[1]
image_resized = cv2.resize(image, (width/10, height/10))
return image_resized
Could someone point out to me what did I do wrong that called this exception?
I get assertion failure error when try to rotate sprite, i guess. The game sim run well exception sometime this error happen. I don't known why?
and this my Log file:
Assertion failure in -[CCSprite rotation], /Users/SCN/Desktop/Stick-ninja-test/Stick-ninja-test/libs/cocos2d/CCNode.m:207
2015-03-24 08:39:42.207 Fish-hunt[548:a0b] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'CCNode#rotation. RotationX != RotationY. Don't know which one to return'
* First throw call stack:
(
0 CoreFoundation 0x02c1b5e4 exceptionPreprocess + 180
1 libobjc.A.dylib 0x022678b6 objc_exception_throw + 44
2 CoreFoundation 0x02c1b448 +[NSException raise:format:arguments:] + 136
3 Foundation 0x019c2fee -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
4 Fish-hunt 0x000f4f8c -[CCNode rotation] + 236
5 Fish-hunt 0x00084dd5 -[GameLayer update:] + 7621
6 Fish-hunt 0x000e46af -[CCScheduler update:] + 447
7 Fish-hunt 0x000e4e01 -[CCDirectorIOS drawScene] + 225
8 Fish-hunt 0x000e68e4 -[CCDirectorDisplayLink mainLoop:] + 52
9 QuartzCore 0x0130db8a _ZN2CA7Display15DisplayLinkItem8dispatchEv + 48
10 QuartzCore 0x0130da46 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 310
11 QuartzCore 0x0130df6b _ZN2CA7Display16TimerDisplayLink8callbackEP16__CFRunLoopTimerPv + 123
12 CoreFoundation 0x02bd9bd6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 22
13 CoreFoundation 0x02bd95bd __CFRunLoopDoTimer + 1181
14 CoreFoundation 0x02bc1628 __CFRunLoopRun + 1816
15 CoreFoundation 0x02bc0ac3 CFRunLoopRunSpecific + 467
16 CoreFoundation 0x02bc08db CFRunLoopRunInMode + 123
17 GraphicsServices 0x0396b9e2 GSEventRunModal + 192
18 GraphicsServices 0x0396b809 GSEventRun + 104
19 UIKit 0x00360d3b UIApplicationMain + 1225
20 Fish-hunt 0x00099a46 main + 134
21 Fish-hunt 0x00002a05 start + 53
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Would you tell my why? thanks
I know you got the answer, but you have not mentioned how you resolved it. So I am giving how I resolved the same for other user having the same problem.
If you are using only setRotation() and getRotation(). check the value at some point in setRotation() is invalid like NaN or someother value which is not valid. Cocos2d does not give error while setting but after that when you do getRotation(), it gives the error.
I'm using wxWidgets, and I have a wxTreeCtrl set up with a root and a single child. I'm setting client data on the child and it works fine until the window closes, at which point I get a bus error, which I'm assuming is coming from wxWidgets attempting to delete my client data.
Here's my client data struct:
struct MapPtrCtr {
Map* map;
MapPtrCtr(Map* map) : map(map) {}
};
Here's how I set the client data (note that here, map is std::shared_ptr<Map>):
wxTreeItemId childNode = mapTree->AppendItem(node, map->getTitle());
mapTree->SetItemData(childNode, (wxTreeItemData*) new MapPtrCtr(map.get()));
Here's the error I get:
Process: AromatherapyMapEditor [43832]
Path: /Users/USER/*/AromatherapyMapEditor
Identifier: AromatherapyMapEditor
Version: 0
Code Type: X86-64 (Native)
Parent Process: bash [805]
Responsible: Terminal [798]
User ID: 501
Date/Time: 2015-03-16 13:38:02.964 -0400
OS Version: Mac OS X 10.10.1 (14B25)
Report Version: 11
Anonymous UUID: 3887BB6D-7783-EBA5-C86C-FACE1C21094E
Sleep/Wake UUID: 9C9670EA-BBC7-4046-B544-F1CE3F184398
Time Awake Since Boot: 84000 seconds
Time Since Wake: 12000 seconds
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00007fb920f1ae80
VM Regions Near 0x7fb920f1ae80:
MALLOC_TINY 00007fb920d00000-00007fb920f00000 [ 2048K] rw-/rwx SM=PRV
--> MALLOC_TINY 00007fb920f00000-00007fb921000000 [ 1024K] rw-/rwx SM=COW
MALLOC_SMALL 00007fb921000000-00007fb921800000 [ 8192K] rw-/rwx SM=COW
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 ??? 0x00007fb920f1ae80 0 + 140433098387072
1 libwx_osx_cocoau_core-3.0.dylib 0x00000001075f6a26 wxGenericTreeItem::DeleteChildren(wxGenericTreeCtrl*) + 94
2 libwx_osx_cocoau_core-3.0.dylib 0x00000001075fabe2 wxGenericTreeCtrl::Delete(wxTreeItemId const&) + 264
3 libwx_osx_cocoau_core-3.0.dylib 0x00000001075fac64 wxGenericTreeCtrl::DeleteAllItems() + 40
4 libwx_osx_cocoau_core-3.0.dylib 0x00000001075f925c wxGenericTreeCtrl::~wxGenericTreeCtrl() + 102
5 libwx_osx_cocoau_core-3.0.dylib 0x000000010759f96b wxTreeCtrl::~wxTreeCtrl() + 15
6 libwx_osx_cocoau_core-3.0.dylib 0x00000001075a5da0 wxWindowBase::Destroy() + 40
7 libwx_osx_cocoau_core-3.0.dylib 0x00000001075a5e96 wxWindowBase::DestroyChildren() + 20
8 libwx_osx_cocoau_core-3.0.dylib 0x0000000107438d79 wxWindow::~wxWindow() + 215
9 libwx_osx_cocoau_core-3.0.dylib 0x00000001075effeb wxSplitterWindow::~wxSplitterWindow() + 15
10 libwx_osx_cocoau_core-3.0.dylib 0x00000001075a5da0 wxWindowBase::Destroy() + 40
11 libwx_osx_cocoau_core-3.0.dylib 0x00000001075a5e96 wxWindowBase::DestroyChildren() + 20
12 libwx_osx_cocoau_core-3.0.dylib 0x0000000107435121 wxNonOwnedWindow::~wxNonOwnedWindow() + 45
13 AromatherapyMapEditor 0x000000010739f913 MapeditFrame::~MapeditFrame() + 259 (frame.h:24)
14 AromatherapyMapEditor 0x000000010739e1f5 MapeditFrame::~MapeditFrame() + 21 (frame.h:24)
15 AromatherapyMapEditor 0x000000010739e219 MapeditFrame::~MapeditFrame() + 25 (frame.h:24)
16 libwx_baseu-3.0.dylib 0x000000010795ec72 wxAppConsoleBase::DeletePendingObjects() + 74
17 libwx_baseu-3.0.dylib 0x000000010795ebd3 wxAppConsoleBase::ProcessIdle() + 85
18 libwx_osx_cocoau_core-3.0.dylib 0x00000001074dcef6 wxAppBase::ProcessIdle() + 22
19 libwx_osx_cocoau_core-3.0.dylib 0x000000010746be5a wxApp::ProcessIdle() + 26
20 libwx_baseu-3.0.dylib 0x0000000107984faa wxEventLoopBase::ProcessIdle() + 28
21 libwx_baseu-3.0.dylib 0x0000000107a0d661 wxCFEventLoop::CommonModeObserverCallBack(__CFRunLoopObserver*, int) + 69
22 com.apple.CoreFoundation 0x00007fff8db02d87 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
23 com.apple.CoreFoundation 0x00007fff8db02ce0 __CFRunLoopDoObservers + 368
24 com.apple.CoreFoundation 0x00007fff8daf4f1a __CFRunLoopRun + 1178
25 com.apple.CoreFoundation 0x00007fff8daf4838 CFRunLoopRunSpecific + 296
26 com.apple.HIToolbox 0x00007fff926dd43f RunCurrentEventLoopInMode + 235
27 com.apple.HIToolbox 0x00007fff926dd1ba ReceiveNextEventCommon + 431
28 com.apple.HIToolbox 0x00007fff926dcffb _BlockUntilNextEventMatchingListInModeWithFilter + 71
29 com.apple.AppKit 0x00007fff8b6906d1 _DPSNextEvent + 964
30 com.apple.AppKit 0x00007fff8b68fe80 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 194
31 com.apple.AppKit 0x00007fff8b683e23 -[NSApplication run] + 594
32 libwx_osx_cocoau_core-3.0.dylib 0x00000001074bdd8c wxGUIEventLoop::OSXDoRun() + 106
33 libwx_baseu-3.0.dylib 0x0000000107a0db35 wxCFEventLoop::DoRun() + 39
34 libwx_baseu-3.0.dylib 0x0000000107984ed8 wxEventLoopBase::Run() + 88
35 libwx_baseu-3.0.dylib 0x000000010795ea04 wxAppConsoleBase::MainLoop() + 128
36 libwx_osx_cocoau_core-3.0.dylib 0x000000010746bea8 wxApp::OnRun() + 26
37 libwx_baseu-3.0.dylib 0x00000001079b33ae wxEntry(int&, wchar_t**) + 71
38 AromatherapyMapEditor 0x000000010738d706 main + 38 (main.cpp:15)
39 libdyld.dylib 0x00007fff916bf5c9 start + 1
Any suggestions? I'm not sure how to properly use wxTreeItemData because there's very little documentation on it. The docs say to make sure to initialize the struct with new, and I do, so I'm not sure why there's a problem.
That was quick. I figured out how to properly use wxTreeItemData: you have to subclass it, not just cast to it. The following client data class works:
class MapPtrCtr : public wxTreeItemData {
public:
Map* map;
MapPtrCtr(Map* map) : map(map) {}
};