mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Bug 721582 - We should probably use a strong assert for target in AsyncExecuteStatements::execute. r=mak.
This commit is contained in:
parent
43949c6bb1
commit
4b16c44d01
@ -215,7 +215,17 @@ AsyncExecuteStatements::execute(StatementDataArray &aStatements,
|
||||
|
||||
// Dispatch it to the background
|
||||
nsIEventTarget *target = aConnection->getAsyncExecutionTarget();
|
||||
NS_ENSURE_TRUE(target, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
// If we don't have a valid target, this is a bug somewhere else. In the past,
|
||||
// this assert found cases where a Run method would schedule a new statement
|
||||
// without checking if asyncClose had been called. The caller must prevent
|
||||
// that from happening or, if the work is not critical, just avoid creating
|
||||
// the new statement during shutdown. See bug 718449 for an example.
|
||||
MOZ_ASSERT(target);
|
||||
if (!target) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
nsresult rv = target->Dispatch(event, NS_DISPATCH_NORMAL);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user