fix: (hack) Ensure vizinterface knows about RWModels enum. #845
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Work-around to fix a minor issue when trying to read the
RWModel
value ofRWConfigLogMsgPayload
s whenvizInterface
is also available. Here, Python would interpret RWConfigLogMsgPayloads as actually coming from thevizinterface
module. However, thevizinterface
module was not aware of the "RWModels" enum, so SWIG did not know how to interpret it as an integer, nor how to destroy it (leading to some "detected a memory leak of type 'RWModels *'" warnings). With this fix,RWModels
correctly returns an integer, and the warning disappears.NOTE: This is not a proper fix, but only works around the issue in the same way we've been doing before. We should really tackle the root cause at some point.
Root cause: This kind of issue is also present in other types, e.g.
SysModel
, seemingly because of how we're copying SWIG types across many modules. For example, theSysModel
definition re-appears in each individual message module. Fixing this (e.g. such thatSysModel
is only defined in one module) would probably significantly reduce the size of the total compiled Basilisk.Verification
I don't really have a minimal way to test this, but basically, when getting the value of a
RWConfigLogMsgPayload
's.RWModel
, it was returning aSwig Object of type 'RWModels *'
instead of an integer. After this fix, it correctly returns an integer.Documentation
Future work