Is this the proper way to use Downloader?

Is this the proper way to use Downloader?
0.0 0

#1

i’m just make sure is this the best way to use Downloader, i wonder if my code may cause some leak.
I use cocos Downloader like this:

in header:
std::unique_ptr<Downloader>_downloader;

and on download:
_downloader.reset(new Downloader());
_downloader->createDownloadFileTask(parameters);

//and implement some listener
_downloader->onFileTaskSuccess

do i need to delete or reset Downloader after usage?