Skip to content

Commit e233cd1

Browse files
committed
windows appears to sometimes move the unique_ptr and send an empty PublisherInfo to SavePublisherInfoOnFileTaskRunner. Explicitly make a copy before binding the callback
fix brave/brave-browser#1326
1 parent 8e0bbc0 commit e233cd1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/brave_rewards/browser/rewards_service_impl.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,10 @@ void RewardsServiceImpl::OnPublisherStateSaved(
575575
void RewardsServiceImpl::SavePublisherInfo(
576576
std::unique_ptr<ledger::PublisherInfo> publisher_info,
577577
ledger::PublisherInfoCallback callback) {
578+
ledger::PublisherInfo info_copy = *publisher_info;
578579
base::PostTaskAndReplyWithResult(file_task_runner_.get(), FROM_HERE,
579580
base::Bind(&SavePublisherInfoOnFileTaskRunner,
580-
*publisher_info,
581+
info_copy,
581582
publisher_info_backend_.get()),
582583
base::Bind(&RewardsServiceImpl::OnPublisherInfoSaved,
583584
AsWeakPtr(),

0 commit comments

Comments
 (0)