summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2024-07-19 17:38:54 -0400
committerGlenn Smith <glenn@vector35.com>2024-07-24 18:03:22 -0400
commit0368556296622756576449861940973500592131 (patch)
tree5e40258a0def001a56943455152433855fc613a3 /python
parent892a0729a587d3a4e8ac248e4eee8a73c7ccc5d1 (diff)
Fix every call to _init_plugins() causing a license checkout
Diffstat (limited to 'python')
-rw-r--r--python/__init__.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/python/__init__.py b/python/__init__.py
index 144e2643..3104e14a 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -224,12 +224,12 @@ def _init_plugins():
global _plugin_init
global _enterprise_license_checkout
- if not core_ui_enabled() and core.BNGetProduct() == "Binary Ninja Enterprise Client":
- # Enterprise client needs to checkout a license reservation or else BNInitPlugins will fail
- _enterprise_license_checkout = enterprise.LicenseCheckout()
- _enterprise_license_checkout.acquire()
-
if not _plugin_init:
+ if not core_ui_enabled() and core.BNGetProduct() == "Binary Ninja Enterprise Client":
+ # Enterprise client needs to checkout a license reservation or else BNInitPlugins will fail
+ _enterprise_license_checkout = enterprise.LicenseCheckout()
+ _enterprise_license_checkout.acquire()
+
# The first call to BNInitCorePlugins returns True for successful initialization and True in this context indicates headless operation.
# The result is pulled from BNInitPlugins as that now wraps BNInitCorePlugins.
is_headless_init_once = core.BNInitPlugins(not os.environ.get('BN_DISABLE_USER_PLUGINS'))