diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-10 10:55:06 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-06-10 10:55:06 +1200 |
commit | 1dc1e06cfd4b7b23775984a254723b2d06b4f1dd (patch) | |
tree | 6dd89b120a7400ff3f08b2cb213cadc27112d0e7 /src/org/traccar/protocol/MeitrackProtocolDecoder.java | |
parent | 58a222ba3d546dc2366586f2c904e70680a394bd (diff) | |
download | trackermap-server-1dc1e06cfd4b7b23775984a254723b2d06b4f1dd.tar.gz trackermap-server-1dc1e06cfd4b7b23775984a254723b2d06b4f1dd.tar.bz2 trackermap-server-1dc1e06cfd4b7b23775984a254723b2d06b4f1dd.zip |
Handle buffers reference count
Diffstat (limited to 'src/org/traccar/protocol/MeitrackProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/MeitrackProtocolDecoder.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java index dcd1b0d91..465cfd9fa 100644 --- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -471,7 +471,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { switch (type) { case "D00": if (photo == null) { - photo = Unpooled.buffer(); // TODO ref count + photo = Unpooled.buffer(); } index = index + 1 + type.length() + 1; @@ -494,6 +494,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { getLastLocation(position, null); position.set(Position.KEY_IMAGE, Context.getMediaManager().writeFile(imei, photo, "jpg")); + photo.release(); photo = null; return position; @@ -504,7 +505,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { return null; } case "D03": - photo = Unpooled.buffer(); // TODO ref count + photo = Unpooled.buffer(); requestPhotoPacket(channel, remoteAddress, imei, "camera_picture.jpg", 0); return null; case "CCC": |