Received event for missing view after view is closed

I have a project in which we have a button that we use for almost everything that we store in it’s own view as a sort of template. We do this because we want standard operation on all buttons across the project. Some of the standar operations that are built into our button template are displaying a popup view when it is clicked and disabled, and changing an internal property on the two events: “onMouseEnter” & “onMouseLeave”.

I am seeing an issue with all instances of this button where when it is used to close a popup window, I receive a gateway warning message reading “Event received for missing view”. I am suspecting that this is due to the “onMouseLeave” event firing but then, since the view is already closed due to its primary function being to close the popup, not being able to execute it’s script. Am I correct in assuming that this is the cause of these messages, and if so, does anyone have any ideas on how to get rid of these?