DG
почему не сработает?
Size: a a a
DG
K
0
DG
MG
MG
MG
AT
MG
_backend = engine->set_backend ("AAudio", "Unit-Test", "");
MG
MG
MG
k
EB
k
w
MG
static std::shared_ptr<AudioBackend> _backend;
std::shared_ptr<AudioBackend>and
AudioEngine::set_backend (const std::string& name, const std::string& arg1, const std::string& arg2)
{
// ...
std::shared_ptr<AudioBackend> x_;
LOGE("_backend use count: %ld", _backend.use_count());
LOGE("x_ use count: %ld", x_.use_count());
x_ = _backend;
LOGE("_backend use count: %ld", _backend.use_count());
LOGE("x_ use count: %ld", x_.use_count());
return x_;
}
// ...
engine->set_backend ("AAudio", "Unit-Test", "");
LOGE("_backend use count: %ld", _backend.use_count());
E/AudioEngine: _backend use count: 2
x_ use count: 0
E/AudioEngine: _backend use count: 3
x_ use count: 3
_backend use count: 0
MG
MG