mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #8019 from jarvte/fix_crash_in_close_cellularnetwork
Cellular: fixed crash when closing CellularNetwork via CellularDevice.pull/8229/head
commit
2e049ce035
|
@ -29,7 +29,6 @@ namespace mbed {
|
||||||
class AT_CellularBase {
|
class AT_CellularBase {
|
||||||
public:
|
public:
|
||||||
AT_CellularBase(ATHandler &at);
|
AT_CellularBase(ATHandler &at);
|
||||||
|
|
||||||
/** Getter for at handler. Common method for all AT-classes.
|
/** Getter for at handler. Common method for all AT-classes.
|
||||||
*
|
*
|
||||||
* @return reference to ATHandler
|
* @return reference to ATHandler
|
||||||
|
|
|
@ -207,9 +207,10 @@ void AT_CellularDevice::close_network()
|
||||||
if (_network) {
|
if (_network) {
|
||||||
_network_ref_count--;
|
_network_ref_count--;
|
||||||
if (_network_ref_count == 0) {
|
if (_network_ref_count == 0) {
|
||||||
release_at_handler(&_network->get_at_handler());
|
ATHandler *atHandler = &_network->get_at_handler();
|
||||||
delete _network;
|
delete _network;
|
||||||
_network = NULL;
|
_network = NULL;
|
||||||
|
release_at_handler(atHandler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -219,9 +220,10 @@ void AT_CellularDevice::close_sms()
|
||||||
if (_sms) {
|
if (_sms) {
|
||||||
_sms_ref_count--;
|
_sms_ref_count--;
|
||||||
if (_sms_ref_count == 0) {
|
if (_sms_ref_count == 0) {
|
||||||
release_at_handler(&_sms->get_at_handler());
|
ATHandler *atHandler = &_sms->get_at_handler();
|
||||||
delete _sms;
|
delete _sms;
|
||||||
_sms = NULL;
|
_sms = NULL;
|
||||||
|
release_at_handler(atHandler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -231,9 +233,10 @@ void AT_CellularDevice::close_power()
|
||||||
if (_power) {
|
if (_power) {
|
||||||
_power_ref_count--;
|
_power_ref_count--;
|
||||||
if (_power_ref_count == 0) {
|
if (_power_ref_count == 0) {
|
||||||
release_at_handler(&_power->get_at_handler());
|
ATHandler *atHandler = &_power->get_at_handler();
|
||||||
delete _power;
|
delete _power;
|
||||||
_power = NULL;
|
_power = NULL;
|
||||||
|
release_at_handler(atHandler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -243,9 +246,10 @@ void AT_CellularDevice::close_sim()
|
||||||
if (_sim) {
|
if (_sim) {
|
||||||
_sim_ref_count--;
|
_sim_ref_count--;
|
||||||
if (_sim_ref_count == 0) {
|
if (_sim_ref_count == 0) {
|
||||||
release_at_handler(&_sim->get_at_handler());
|
ATHandler *atHandler = &_sim->get_at_handler();
|
||||||
delete _sim;
|
delete _sim;
|
||||||
_sim = NULL;
|
_sim = NULL;
|
||||||
|
release_at_handler(atHandler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -255,9 +259,10 @@ void AT_CellularDevice::close_information()
|
||||||
if (_information) {
|
if (_information) {
|
||||||
_info_ref_count--;
|
_info_ref_count--;
|
||||||
if (_info_ref_count == 0) {
|
if (_info_ref_count == 0) {
|
||||||
release_at_handler(&_information->get_at_handler());
|
ATHandler *atHandler = &_information->get_at_handler();
|
||||||
delete _information;
|
delete _information;
|
||||||
_information = NULL;
|
_information = NULL;
|
||||||
|
release_at_handler(atHandler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue