Fix memory leak where Struct, _LongBase, _StrBase, String leaked their __dict__ on...
commit5135a35677e25c473db0e8a463f97c15359c9e34
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 7 Feb 2007 12:50:48 +0000 (7 12:50 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 7 Feb 2007 12:50:48 +0000 (7 12:50 +0000)
tree13a486c0fcf4d38540e72e635825c53f251a4a68
parent870227fafd9c976a0354b02aff6052ba24234e91
Fix memory leak where Struct, _LongBase, _StrBase, String leaked their __dict__ on deallocation.
* Use a fixed-size struct for String (unicode objects are in fact fixed-size)
  and store its variant_level that way.
* Don't store Struct, _LongBase, _StrBase variant_level and Struct signature
  in a __dict__, but instead have a global dict mapping object IDs to variant
  levels, and a global dict mapping Struct IDs to signatures. This is a bit
  strange, but easier than correctly freeing the __dict__ (which is stored
  at the end of a variable-length struct, so somewhat hard to get at).
* With this change, allocating objects in a loop no longer leaks memory, and
  neither does the test case supplied by Luka Renko.
_dbus_bindings/abstract.c
_dbus_bindings/containers.c
_dbus_bindings/message-append.c
_dbus_bindings/string.c
_dbus_bindings/types-internal.h