port-serial-at: make mm_port_serial_at_command_finish() transfer ownership
This will make it slightly easier to port mm_port_serial_at_command() to use GTask, since we won't have to keep a pointer to the result in GTask after _finish() has been called. In most cases the caller needs the value anyway, so this doesn't add too much hasle.
This commit is contained in:
committed by
Aleksander Morgado
parent
e1e7bc8de6
commit
c40876de95
@@ -151,10 +151,11 @@ quick_at_ready (MMPortSerialAt *port,
|
||||
{
|
||||
MMPortProbe *probe;
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autofree gchar *response = NULL;
|
||||
|
||||
probe = g_task_get_source_object (task);
|
||||
|
||||
mm_port_serial_at_command_finish (port, res, &error);
|
||||
response = mm_port_serial_at_command_finish (port, res, &error);
|
||||
if (error) {
|
||||
/* On a timeout error, wait for READY URC */
|
||||
if (g_error_matches (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_RESPONSE_TIMEOUT)) {
|
||||
|
||||
Reference in New Issue
Block a user