Commit 4af41182 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron
Browse files

Better RecvImagePackets management: keep AutoPtr during its full life

parent 0b8bc25a
......@@ -85,7 +85,7 @@ public:
void setCPUAffinity(const RecvCPUAffinity& recv_affinity);
ImagePackets *readImagePackets();
AutoPtr<ImagePackets> readImagePackets();
void fillBadFrame(char *buf);
......
......@@ -272,7 +272,7 @@ DetFrameImagePackets Camera::AcqThread::readRecvPackets(FrameType frame)
for (int i = 0; i < nb_recvs; ++i) {
while ((det_packets.find(i) == det_packets.end()) &&
!stopped()) {
Receiver::ImagePackets *image_packets;
AutoPtr<Receiver::ImagePackets> image_packets;
Receiver *recv = m_cam->m_recv_list[i];
image_packets = recv->readImagePackets();
if (!image_packets)
......
......@@ -31,7 +31,6 @@ using namespace lima::SlsDetector;
using namespace FrameAssembler;
struct RecvImagePackets : public Receiver::ImagePackets {
friend class Receiver;
using Receiver::ImagePackets::ImagePackets;
AnyPacketBlockList blocks;
};
......@@ -153,7 +152,7 @@ AutoPtr<Receiver::ImagePackets> Receiver::readSkippableImagePackets()
return image_data;
}
Receiver::ImagePackets *Receiver::readImagePackets()
AutoPtr<Receiver::ImagePackets> Receiver::readImagePackets()
{
DEB_MEMBER_FUNCT();
......@@ -216,7 +215,7 @@ Receiver::ImagePackets *Receiver::readImagePackets()
m_stats.stats.cb_exec.add(t1 - t0);
m_stats.last_t1 = t1;
return image_data.forget();
return image_data;
}
bool Receiver::asmImagePackets(ImagePackets *image_data, char *buffer)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment