py/rna update, reload works again.
- fix for reload (f8) crashing, missing incref when creating the script namespace. - store the module names rather then the modules for reloading incase the modules get out of date.
This commit is contained in:
@@ -44,17 +44,17 @@ def get_console(console_id):
|
||||
from code import InteractiveConsole
|
||||
|
||||
consoles = getattr(get_console, "consoles", None)
|
||||
hash_next = hash(bpy.context.manager)
|
||||
|
||||
if consoles is None:
|
||||
consoles = get_console.consoles = {}
|
||||
get_console.consoles_namespace_hash = hash(bpy.context.manager)
|
||||
get_console.consoles_namespace_hash = hash_next
|
||||
else:
|
||||
# check if clearning the namespace is needed to avoid a memory leak.
|
||||
# the window manager is normally loaded with new blend files
|
||||
# so this is a reasonable way to deal with namespace clearing.
|
||||
# bpy.data hashing is reset by undo so cant be used.
|
||||
hash_prev = getattr(get_console, "consoles_namespace_hash", 0)
|
||||
hash_next = hash(bpy.context.manager)
|
||||
|
||||
if hash_prev != hash_next:
|
||||
get_console.consoles_namespace_hash = hash_next
|
||||
|
Reference in New Issue
Block a user