Issue: Customers have noted that every once in a while, right-click operations implemented in G do not work, but when they try to reproduce the issue, everything works fine. Some users have written the issue off to "I must have clicked the wrong thing." But, no, it turns out that there is a rare race condition in the transaction logic for the right-click plugins.
Fix: This issue will be fixed in LabVIEW 2020. We may at some point issue a patch for some older versions, but that will take time, and we might not ever patch all the way back. Luckily, this issue can be fixed in all older versions now by modifying one shipping VI. If you are seeing this problem, you can download the attached VI (saved in LV 2015, the oldest version where right-click plug-ins are supported) and replace this file:
resource\plugins\PopupMenus\support\Call Popup PlugIn Execution VI.vi
Lesson: As I have often taught: programming with refnums is inherently dangerous because it creates the possibility of the worst class of bugs. Race conditions can make customers think they're going insane and second-guess their own confidence... they're sure they did it right the first time (and they did!). I apologize for the confusion this bug caused. So, folks, stick with by-value dataflow where ever you can, so you can minimize having to apologize like this to your own customers!
This patch fixed issues I was having with asynchronous message handlers in my plugin causing rollback of scripts. Thanks!
Fantastic!
I've created a VI Package that will apply this patch in LabVIEW 2015-2019.
https://www.vipm.io/package/ni_patch_labview_right_click_plugin_bugfix/
-Jim
Jim,
Fantastic! I've got an LVTN package that implements a Right-Click menu option. I had reports of misbehaviour that is resolved after applying this patch. I assume it's acceptable to add your package above as a dependency of mine in future versions?
Regards
Chris
I assume it's acceptable to add your package above as a dependency of mine in future versions?
I see no barrier to that.