cwIo.cpp : Serial port server is now only started if a serial port is enabled.
Fixed memory leaks.
This commit is contained in:
parent
70c2aa5271
commit
321120af15
14
cwIo.cpp
14
cwIo.cpp
@ -404,15 +404,17 @@ namespace cw
|
||||
{
|
||||
serialPortSrv::destroy(p->serialPortSrvH);
|
||||
|
||||
mem::free(p->serialA);
|
||||
mem::release(p->serialA);
|
||||
p->serialN = 0;
|
||||
|
||||
}
|
||||
|
||||
rc_t _serialPortStart( io_t* p )
|
||||
{
|
||||
rc_t rc;
|
||||
rc_t rc = kOkRC;
|
||||
|
||||
// the service is only started if at least one serial port is enabled
|
||||
if( serialPort::portCount( serialPortSrv::serialHandle(p->serialPortSrvH) ) > 0 )
|
||||
if((rc =serialPortSrv::start( p->serialPortSrvH )) != kOkRC )
|
||||
rc = cwLogError(rc,"The serial port server start failed.");
|
||||
|
||||
@ -1639,7 +1641,10 @@ namespace cw
|
||||
if((rc = thread_mach::destroy(p->threadMachH)) != kOkRC )
|
||||
return rc;
|
||||
|
||||
mem::free(p->timerA);
|
||||
for(unsigned i=0; i<p->timerN; ++i)
|
||||
mem::release(p->timerA[i].label);
|
||||
|
||||
mem::release(p->timerA);
|
||||
p->timerN = 0;
|
||||
|
||||
_serialPortDestroy(p);
|
||||
@ -1648,6 +1653,8 @@ namespace cw
|
||||
|
||||
midi::device::destroy(p->midiH);
|
||||
|
||||
sock::destroyMgr( p->sockH );
|
||||
|
||||
mem::release(p->sockA);
|
||||
|
||||
for(unsigned i=0; i<p->uiMapN; ++i)
|
||||
@ -1657,6 +1664,7 @@ namespace cw
|
||||
|
||||
ui::ws::destroy(p->wsUiH);
|
||||
|
||||
|
||||
// free the cfg object
|
||||
if( p->cfg != nullptr )
|
||||
p->cfg->free();
|
||||
|
Loading…
Reference in New Issue
Block a user