Skip to content

Issue reopening snippet editor (and work around) #46

Description

@CunningLogic

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions