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

Issue reopening snippet editor (and work around) #46

Open
CunningLogic opened this issue Feb 9, 2024 · 0 comments
Open

Issue reopening snippet editor (and work around) #46

CunningLogic opened this issue Feb 9, 2024 · 0 comments

Comments

@CunningLogic
Copy link

Open binary
Open snippet editor
Run Snippet
Close Snippet editor
Close binary
Open binary
Attempt to open snippet editor

[Default] Traceback (most recent call last):
[Default]   File "/home/jcase/.binaryninja/repositories/official/plugins/Vector35_snippets/__init__.py", line 764, in launchPlugin
[Default]     snippets.show()
[Default] RuntimeError: Internal C++ object (Snippets) already deleted.
def launchPlugin(context):
    global snippets
    if not snippets:
        snippets = Snippets(context, parent=context.widget)  
    snippets.show()

adding a try except to snippets.show, and recreating the object on exception fixes it for me (I acknowledge that is not going to be the correct fix)


def launchPlugin(context):
    global snippets
    if not snippets:
        snippets = Snippets(context, parent=context.widget)
    try:   
        snippets.show()
    except:
        snippets = Snippets(context, parent=context.widget)
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

1 participant