From: Martin Ling Date: Thu, 24 Jul 2014 17:10:33 +0000 (+0100) Subject: C++: Fix Packet destructor for packets without payload. X-Git-Tag: libsigrok-0.4.0~1204 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=1797a887d7672caa1e0fc1ff87a26de2370a8381;p=libsigrok.git C++: Fix Packet destructor for packets without payload. --- diff --git a/bindings/cxx/classes.cpp b/bindings/cxx/classes.cpp index 7b8d8531..285025be 100644 --- a/bindings/cxx/classes.cpp +++ b/bindings/cxx/classes.cpp @@ -916,7 +916,8 @@ Packet::Packet(const struct sr_datafeed_packet *structure) : Packet::~Packet() { - delete payload; + if (payload) + delete payload; } const PacketType *Packet::get_type()