CAN packer/parser: clean up after alloc (#1007)
* Update packer_pyx.pyx * this new also needs to be cleaned up
This commit is contained in:
parent
7397e466d9
commit
3d1be8427a
|
@ -26,6 +26,10 @@ cdef class CANPacker:
|
|||
msg = self.dbc[0].msgs[i]
|
||||
self.name_to_address[string(msg.name)] = msg.address
|
||||
|
||||
def __dealloc__(self):
|
||||
if self.packer:
|
||||
del self.packer
|
||||
|
||||
cdef vector[uint8_t] pack(self, addr, values):
|
||||
cdef vector[SignalPackValue] values_thing
|
||||
values_thing.reserve(len(values))
|
||||
|
|
|
@ -66,6 +66,10 @@ cdef class CANParser:
|
|||
self.can = new cpp_CANParser(bus, dbc_name, message_v)
|
||||
self.update_strings([])
|
||||
|
||||
def __dealloc__(self):
|
||||
if self.can:
|
||||
del self.can
|
||||
|
||||
def update_strings(self, strings, sendcan=False):
|
||||
for v in self.vl_all.values():
|
||||
for l in v.values(): # no-cython-lint
|
||||
|
|
Loading…
Reference in New Issue