]> sigrok.org Git - libsigrok.git/commitdiff
C++: Fix Packet destructor for packets without payload.
authorMartin Ling <redacted>
Thu, 24 Jul 2014 17:10:33 +0000 (18:10 +0100)
committerMartin Ling <redacted>
Thu, 24 Jul 2014 22:42:51 +0000 (23:42 +0100)
bindings/cxx/classes.cpp

index 7b8d8531f899a74ca3fa30822933d5d3f3386adf..285025be356675ee27e5b3b03558a20e24790ff2 100644 (file)
@@ -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()