Skip to content

Commit 1d2c9b3

Browse files
committed
Fix build
1 parent 7d43fa1 commit 1d2c9b3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void example2(async::AsyncHttp& http)
113113
// ---------------------------------------------------------------------------
114114
static std::atomic<int> workersDone{0};
115115

116-
static void WorkerGetWait(async::AsyncHttp* http, std::string threadName)
116+
static void WorkerGetWait(std::shared_ptr<async::AsyncHttp> http, std::string threadName)
117117
{
118118
async::HttpResponse resp = http->GetWait("https://httpbin.org/get",
119119
std::chrono::seconds(15));
@@ -135,9 +135,10 @@ std::chrono::microseconds example3(async::AsyncHttp& http)
135135

136136
auto start = std::chrono::high_resolution_clock::now();
137137

138+
auto httpPtr = std::shared_ptr<async::AsyncHttp>(&http, [](async::AsyncHttp*){});
138139
for (int i = 0; i < WORKER_THREAD_CNT; ++i) {
139140
auto delegate = MakeDelegate(WorkerGetWait, workerThreads[i]);
140-
delegate(&http, workerThreads[i].GetThreadName());
141+
delegate(httpPtr, workerThreads[i].GetThreadName());
141142
}
142143

143144
std::unique_lock<std::mutex> lock(cvMtx);

0 commit comments

Comments
 (0)