Community
Participate
Working Groups
Quote Nikita from bug 513075 comment 18: > Also, trycatch flag has to go. There are exactly zero valid uses for it. Unfortunately Nikita had not wrote much more details so I had to search myself. Bug 329518 introduced trycatch on two native functions. (as a 'temporary work around'; 8 years ago...) This had indeed influence on bug 513075 but from my research without the trycatch it will still hard crash. Only a bit more gracefully most of the time. Anyway one of the trycatch was added on VtblCall(int fnNumber, long ppVtbl) which is used for any com object method without arguments which includes the often used IUnknown->AddRef and IUnknown->Release. While I have no time to revisit bug 329518 I suggest to remove trycatch from this VtblCall and add a different named VtblCall with trycatch just for the (maybe still) failing Release invocation of bug 329518. From what I know so far SWT JNI code generator already support this plan.
Impressive Paul, how you get more and more into SWT native development. Thanks!
Sorry for not providing details, Paul. trycatch is a decade old _temporary_ fix for a bug in some unspecified 3rd party native code. There's no reason to keep it.
(In reply to Nikita Nemkin from comment #2) > Sorry for not providing details, Paul. > > trycatch is a decade old _temporary_ fix for a bug in some unspecified 3rd > party native code. There's no reason to keep it. Hey! You are still around, great to hear from you. I was a bit concerned that something happened to you.
I made this ticket now so I can close the other one where it started. I had not fully thought it out yet. One of the trycatch-ed methods and the more important to change back is the VtblCall. While I still think it is possible to provide two variants, one with and one without trycatch, it is rather hard to use the distinct methods. On one hand it will probably make the code a lot more ugly and on the other hand bug 329518 mentioned the failing call is a Release but not which one so I would have to guess anyway. Additional the original bug was reported for Windows XP in context of embedded IE. Given all that I would prefer to simply remove trycatch on the VtblCall and assume the underlying problem was fixed in Windows, IE or client code meanwhile.
New Gerrit change created: https://git.eclipse.org/r/156557
Gerrit change https://git.eclipse.org/r/156557 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=1a8cfba09a1af043fa79523d67f395039e99813a