##// END OF EJS Templates
Fixed Memory leak, GERSB still W.I.P.
Jeandet Alexis -
r77:9bf6663d5c21 GRESB
parent child
Show More
@@ -139,7 +139,7 unsigned int GR_ESB_bridge::Write(unsign
139 RMAP_MAX_XFER_SIZE*4,
139 RMAP_MAX_XFER_SIZE*4,
140 writeBuffer);
140 writeBuffer);
141 manager->sendPacket(writeBuffer,RMAP_WRITE_PACKET_MIN_SZ(RMAP_MAX_XFER_SIZE*4));
141 manager->sendPacket(writeBuffer,RMAP_WRITE_PACKET_MIN_SZ(RMAP_MAX_XFER_SIZE*4));
142 int len = manager->getRMAPanswer(transactionID,&RMAPAckBuff);
142 manager->getRMAPanswer(transactionID,&RMAPAckBuff);
143 free(RMAPAckBuff);
143 free(RMAPAckBuff);
144 written+=RMAP_MAX_XFER_SIZE;
144 written+=RMAP_MAX_XFER_SIZE;
145 count-=RMAP_MAX_XFER_SIZE;
145 count-=RMAP_MAX_XFER_SIZE;
@@ -166,7 +166,7 unsigned int GR_ESB_bridge::Write(unsign
166 count*4,
166 count*4,
167 writeBuffer);
167 writeBuffer);
168 manager->sendPacket(writeBuffer,RMAP_WRITE_PACKET_MIN_SZ(count*4));
168 manager->sendPacket(writeBuffer,RMAP_WRITE_PACKET_MIN_SZ(count*4));
169 int len = manager->getRMAPanswer(transactionID,&RMAPAckBuff);
169 manager->getRMAPanswer(transactionID,&RMAPAckBuff);
170 free(RMAPAckBuff);
170 free(RMAPAckBuff);
171 written+=count;
171 written+=count;
172 if(progress!=NULL)
172 if(progress!=NULL)
@@ -224,8 +224,11 unsigned int GR_ESB_bridge::Read(unsigne
224 free(RMAP_AnswerBuffer);
224 free(RMAP_AnswerBuffer);
225 read+=RMAP_MAX_XFER_SIZE;
225 read+=RMAP_MAX_XFER_SIZE;
226 count-=RMAP_MAX_XFER_SIZE;
226 count-=RMAP_MAX_XFER_SIZE;
227 progress->setValue(read);
227 if(progress!=NULL)
228 qApp->processEvents();
228 {
229 progress->setValue(read);
230 qApp->processEvents();
231 }
229 }
232 }
230 if((int)count>0)
233 if((int)count>0)
231 {
234 {
@@ -481,11 +484,12 bool GR_ESB_Manager::sendPacket(char *pa
481 SPWpacket[1]=(size>>16) & 0x0FF;
484 SPWpacket[1]=(size>>16) & 0x0FF;
482 SPWpacket[2]=(size>>8) & 0x0FF;
485 SPWpacket[2]=(size>>8) & 0x0FF;
483 SPWpacket[3]=size & 0x0FF;
486 SPWpacket[3]=size & 0x0FF;
487 this->handleMutex->lock();
488 result = ((size+4) == this->Write_soc.write(SPWpacket,size+4));
489 this->Write_soc.flush();
490 this->handleMutex->unlock();
491 free(SPWpacket);
484 }
492 }
485 this->handleMutex->lock();
486 result = ((size+4) == this->Write_soc.write(SPWpacket,size+4));
487 this->Write_soc.flush();
488 this->handleMutex->unlock();
489 if (Q_UNLIKELY(!result))
493 if (Q_UNLIKELY(!result))
490 {
494 {
491 SocExplorerEngine::message(this->plugin,"ERR sending the READ command ",2);
495 SocExplorerEngine::message(this->plugin,"ERR sending the READ command ",2);
@@ -215,8 +215,11 unsigned int stardundeeSPW_USB::Read(uns
215 free(RMAP_AnswerBuffer);
215 free(RMAP_AnswerBuffer);
216 read+=RMAP_MAX_XFER_SIZE;
216 read+=RMAP_MAX_XFER_SIZE;
217 count-=RMAP_MAX_XFER_SIZE;
217 count-=RMAP_MAX_XFER_SIZE;
218 progress->setValue(read);
218 if(progress!=NULL)
219 qApp->processEvents();
219 {
220 progress->setValue(read);
221 qApp->processEvents();
222 }
220 }
223 }
221 if((int)count>0)
224 if((int)count>0)
222 {
225 {
@@ -855,7 +858,7 void stardundeeSPW_USB_Manager::initiali
855 unsigned int stardundeeSPW_USB_Manager::getLinkStatus(unsigned char link)
858 unsigned int stardundeeSPW_USB_Manager::getLinkStatus(unsigned char link)
856 {
859 {
857 U32 statusControl, errorStatus, portType;
860 U32 statusControl, errorStatus, portType;
858 U32 linkStatus, operatingSpeed, outputPortConnection;
861 U32 linkStatus=0, operatingSpeed, outputPortConnection;
859 char isLinkRunning, isAutoStart, isStart, isDisabled, isTristate;
862 char isLinkRunning, isAutoStart, isStart, isDisabled, isTristate;
860
863
861 // Read the link status control register
864 // Read the link status control register
General Comments 0
You need to be logged in to leave comments. Login now