mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Delay HTTPDownloader dtor until current session finishes
This commit is contained in:
@@ -80,19 +80,22 @@ class DatabaseDownloader_test : public beast::unit_test::suite
|
||||
{
|
||||
test::StreamSink sink_;
|
||||
beast::Journal journal_;
|
||||
// The DatabaseDownloader must be created as shared_ptr
|
||||
// because it uses shared_from_this
|
||||
std::shared_ptr<DatabaseDownloader> ptr_;
|
||||
|
||||
Downloader(jtx::Env& env)
|
||||
: journal_{sink_}
|
||||
, ptr_{std::make_shared<DatabaseDownloader>(
|
||||
, ptr_{make_DatabaseDownloader(
|
||||
env.app().getIOService(),
|
||||
journal_,
|
||||
env.app().config())}
|
||||
env.app().config(),
|
||||
journal_)}
|
||||
{
|
||||
}
|
||||
|
||||
~Downloader()
|
||||
{
|
||||
ptr_->onStop();
|
||||
}
|
||||
|
||||
DatabaseDownloader*
|
||||
operator->()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user