The code responsible for the error:
for s in bpy.data.screens:
if '.' in s.name or s.name.startswith('temp'): s.user_clear()
I'm trying to write code that clears a bunch of extra screens that get automatically created every time I use bpy.ops.wm.window_new(). I thought I could just run
user_clear() on each screen and then the orphans purge call would automatically remove them. This does work successfully the way I intended it to, however in the system console an error is raised that reads:
ERROR (bke.lib_id): C:\Users\blender\git\blender-v310\blender.git\source\blender\blenkernel\intern\lib_id.c:339 id_us_min: ID user decrement error: SRtemp (from '[Main]'): 0 <= 0
This error doesn't seem to affect the actual functioning of Blender in any way, the rest of the code I've written seems to work as intended, and Blender doesn't crash or exhibit any other strange behaviour. If the system console didn't raise this error, I wouldn't even know anything's amiss. I can't figure out any other way to delete these screens that works as intended, so I'm considering just entirely ignoring this error and moving on, but I know that's not best practice. Why is this error being raised and how can I change my code to avoid this?