Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple removeCallback calls in pymel #463

Open
cruz1n opened this issue Mar 14, 2023 · 1 comment
Open

Multiple removeCallback calls in pymel #463

cruz1n opened this issue Mar 14, 2023 · 1 comment

Comments

@cruz1n
Copy link

cruz1n commented Mar 14, 2023

Pymel will call removeCallback for already-loaded plugins if the plugins are loaded again. This occurs here: https://github.com/LumaPictures/pymel/blob/master/pymel/core/__init__.py#L247

If a callback is removed via this code path, the internal callback cache is not updated to reflect this, which can result in a redundant removeCallback call here: https://github.com/LumaPictures/pymel/blob/master/pymel/core/__init__.py#L213

The workaround is to add the following code after removing the callback at line 247: _pluginData[pluginName]['callbackId'] = None

@jamesdeschenes
Copy link

jamesdeschenes commented May 4, 2023

Just to add some extra context - I believe the line numbers in the above links refer to the following commit as the line numbers have changed since the issue was opened.

api.MEventMessage.removeCallback(id)

api.MEventMessage.removeCallback(_pluginData[pluginName]['callbackId'])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants