diff --git a/spwplugin/GR-ESB/gr_esb_bridge.cpp b/spwplugin/GR-ESB/gr_esb_bridge.cpp --- a/spwplugin/GR-ESB/gr_esb_bridge.cpp +++ b/spwplugin/GR-ESB/gr_esb_bridge.cpp @@ -139,7 +139,7 @@ unsigned int GR_ESB_bridge::Write(unsign RMAP_MAX_XFER_SIZE*4, writeBuffer); manager->sendPacket(writeBuffer,RMAP_WRITE_PACKET_MIN_SZ(RMAP_MAX_XFER_SIZE*4)); - int len = manager->getRMAPanswer(transactionID,&RMAPAckBuff); + manager->getRMAPanswer(transactionID,&RMAPAckBuff); free(RMAPAckBuff); written+=RMAP_MAX_XFER_SIZE; count-=RMAP_MAX_XFER_SIZE; @@ -166,7 +166,7 @@ unsigned int GR_ESB_bridge::Write(unsign count*4, writeBuffer); manager->sendPacket(writeBuffer,RMAP_WRITE_PACKET_MIN_SZ(count*4)); - int len = manager->getRMAPanswer(transactionID,&RMAPAckBuff); + manager->getRMAPanswer(transactionID,&RMAPAckBuff); free(RMAPAckBuff); written+=count; if(progress!=NULL) @@ -224,8 +224,11 @@ unsigned int GR_ESB_bridge::Read(unsigne free(RMAP_AnswerBuffer); read+=RMAP_MAX_XFER_SIZE; count-=RMAP_MAX_XFER_SIZE; - progress->setValue(read); - qApp->processEvents(); + if(progress!=NULL) + { + progress->setValue(read); + qApp->processEvents(); + } } if((int)count>0) { @@ -481,11 +484,12 @@ bool GR_ESB_Manager::sendPacket(char *pa SPWpacket[1]=(size>>16) & 0x0FF; SPWpacket[2]=(size>>8) & 0x0FF; SPWpacket[3]=size & 0x0FF; + this->handleMutex->lock(); + result = ((size+4) == this->Write_soc.write(SPWpacket,size+4)); + this->Write_soc.flush(); + this->handleMutex->unlock(); + free(SPWpacket); } - this->handleMutex->lock(); - result = ((size+4) == this->Write_soc.write(SPWpacket,size+4)); - this->Write_soc.flush(); - this->handleMutex->unlock(); if (Q_UNLIKELY(!result)) { SocExplorerEngine::message(this->plugin,"ERR sending the READ command ",2); diff --git a/spwplugin/StarDundee/stardundeespw_usb.cpp b/spwplugin/StarDundee/stardundeespw_usb.cpp --- a/spwplugin/StarDundee/stardundeespw_usb.cpp +++ b/spwplugin/StarDundee/stardundeespw_usb.cpp @@ -215,8 +215,11 @@ unsigned int stardundeeSPW_USB::Read(uns free(RMAP_AnswerBuffer); read+=RMAP_MAX_XFER_SIZE; count-=RMAP_MAX_XFER_SIZE; - progress->setValue(read); - qApp->processEvents(); + if(progress!=NULL) + { + progress->setValue(read); + qApp->processEvents(); + } } if((int)count>0) { @@ -855,7 +858,7 @@ void stardundeeSPW_USB_Manager::initiali unsigned int stardundeeSPW_USB_Manager::getLinkStatus(unsigned char link) { U32 statusControl, errorStatus, portType; - U32 linkStatus, operatingSpeed, outputPortConnection; + U32 linkStatus=0, operatingSpeed, outputPortConnection; char isLinkRunning, isAutoStart, isStart, isDisabled, isTristate; // Read the link status control register