Vector35 / Vector35/snippets

Issue reopening snippet editor (and work around)

Open
#46 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
31
Forks
14
PR merge metrics
No merged PRs in 30d

Description

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)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Vector35_snippets/init.py at launchPlugin and the Snippets object lifecycle. Reproduce the reported sequence: reopen the binary after closing the snippet editor, then attempt to open it again and observe the deleted-object traceback. Done means the snippet editor can be reopened without the RuntimeError or an exception-based workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.