blob: 0d0b4ba200fbb395c9bd37843cf7ca59146acb73 [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "garnet/bin/media/audio_core/pending_flush_token.h"
#include "garnet/bin/media/audio_core/audio_core_impl.h"
#include "lib/fxl/logging.h"
namespace media::audio {
PendingFlushToken::~PendingFlushToken() { FXL_DCHECK(was_recycled_); }
void PendingFlushToken::fbl_recycle() {
if (!was_recycled_) {
was_recycled_ = true;
FXL_DCHECK(service_);
service_->ScheduleFlushCleanup(fbl::unique_ptr<PendingFlushToken>(this));
} else {
delete this;
}
}
} // namespace media::audio