<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>I'm using Qyoto and MonoDevelop under Linux to write applications in C# with Qt GUIs.  I ported TreeItem and TreeModel from the simpletreemodel example to C#, and attached a TreeModel to a QTreeView using its SetModel() method.  But I kept getting low-level crashes in Mono.  Sometimes, I would get a message: "C# instance has been wrongly GC'd for virtual ... call".</div><div><br></div><div>I lucked out finding a workaround; it turns out the data-model was getting garbage-collected.  I just saved a reference to it in my main class, and the problem went away.</div><div><br></div><div>It seems to me that anything passed to QTreeView.SetModel() should be accounted for within Mono's memory-management system, and not get garbage-collected behind its back.</div><div><br></div><div>I found a post on kde-bindings
 from June 2009 (see http://lists.kde.org/?l=kde-bindings&m=124587984005541 to read it) where someone had the same problem, but no one answered his question.</div><div><br></div><div>Hope this helps, though it's my understanding that Qyoto's author is no longer developing it.  That's a shame; Qt and C# seem like a powerful combo for cross-platform application development.<br></div><div><br></div><div>Steven Boswell</div><div><br></div></div></body></html>