diff --git a/features/cellular/framework/AT/AT_CellularContext.cpp b/features/cellular/framework/AT/AT_CellularContext.cpp index 51f7f7ecb54..ec3b93d993b 100644 --- a/features/cellular/framework/AT/AT_CellularContext.cpp +++ b/features/cellular/framework/AT/AT_CellularContext.cpp @@ -741,8 +741,7 @@ void AT_CellularContext::check_and_deactivate_context() } if (_new_context_set) { - _at.clear_error(); - _at.at_cmd_discard("+CGDCONT", "=", "%d", _cid); + delete_current_context(); } _at.restore_at_timeout();