nn::boss::UnregisterTask Function

Syntax

nn::Result UnregisterTask(
     Task * pTask,
     u8 taskStep = DEFAULT_STEP_ID
);

Parameters

Name Description
in pTask Specifies a registered task.
in taskStep Specifies a task step ID. (Can be omitted if there is only one task execution step)
Note: This parameter is for a feature extension and is currently not supported. Do not specify it.

Return Values

Returns the function's result. Returns one of the Result values listed below.
Value Description
Result::IsSuccess Deletion successful.
ResultInvalidTaskId The pTask parameter is NULL.
Alternatively, the pTask parameter is uninitialized, or the pointer of the task ID specified by pTask is NULL or a zero-length string.
ResultTaskNotExist The specified task ID was not found. Confirm whether it is registered yet.
ResultAppNotExist There is no information on the calling application. Returns this error if the application has not run any tasks on BOSS or registered any BOSS storage.
ResultFileAccess Indicates that deletion of a work file for the target task in BOSS storage has failed. (This may occur when the SD Card is removed.) The task itself can be deleted.
ResultIpcNotSessionInitialized The session has not been initialized.
This Result is returned if this function is called before the Initialize function. Always call the Initialize function before using the BOSS library.
A value other than the above. Unexpected error (see boss_Result.h for error details).

Description

Deletes a registered task.

Although you can unregister a task that is currently running or is waiting to run, you will be unable to check that task's execution results. If you want to check the task's execution results, do so after the task has finished running, then call nn::boss::Task::Cancel to prevent the next task from running, and unregister the task.

When deleting a task, work files for the target task in BOSS storage are also deleted. In cases where an SD card that has BOSS storage is removed, deletion of work files fails and the error ResultFileAccess returns. However, in this case the task itself will be deleted. Error handling is not required here because work files may also be deleted due to the deletion of extended save data that uses BOSS storage (you can expect the user to take care of it when the application is not being used.) (If this error returns, you cannot directly delete any work files that could not be deleted. However, if a task having the same task ID has been registered, work files that could not be deleted will be used in the task. Therefore, after registering a task having the same task ID, you delete work files by executing UnregisterTask for that task. )

Revision History

2010/09/16
Initial version.

CONFIDENTIAL