Help! Assert in python gc [solved]

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Help! Assert in python gc [solved]

Post by DeepSOIC »

Hi!
I'm developing a unified container interface object, and Py bindings for it.
I've made some progress, and now that I've added Py bindings, I get an assertion fail in Python garbage collector on FreeCAD startup:
gc assert.png
gc assert.png (148.4 KiB) Viewed 862 times
This happens almost instantly.

If I click Skip twice, FreeCAD starts up, and appears to function normally. The new Py interface, available as App.Containers.Container() seems to function as expected. I get some errors though: TabBar fails to appear, and
Traceback (most recent call last):
File "T:\_vt\dev\PC\Qt\FreeCAD\build-debug\Mod\Tux\PersistentToolbarsGui.py", line 237, in onStart
onWorkbenchActivated()
File "T:\_vt\dev\PC\Qt\FreeCAD\build-debug\Mod\Tux\PersistentToolbarsGui.py", line 225, in onWorkbenchActivated
active = Gui.activeWorkbench().__class__.__name__
AssertionError: No active workbench

Traceback (most recent call last):
File "<string>", line 255, in guiUp
File "<string>", line 246, in getSelectorActionGroup
IndexError: list index out of range
The new Py interface isn't used anywhere yet, apart from being added to App, so I'm puzzled as to where it might come from. I have a suspect it may be in master too... I just haven't investigated much yet.

But if anyone has a clue on what's going on, let me know please.

Code:
https://github.com/DeepSOIC/FreeCAD-ell ... e0d8feb14b
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Help! Assert in python gc [solved]

Post by DeepSOIC »

OK, I just forgot to add Py_INCREF to the Containers module. Doh!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Help! Assert in python gc [solved]

Post by triplus »

Doh! ;)

P.S.
DeepSOIC wrote:I'm developing a unified container interface object, and Py bindings for it.
Sounds good.
Post Reply