Threads: segmentation fault

Mar 29, 2017 at 7:17pm
Hey guys
I am having issues with threads. I am trying to make a thread for my downloader function but for some reason it is giving segmentation fault. Below are the lines of code that are giving me this issue. Can idea why this is happening???

Code
string* Pages = new string[BufferSize]; //BufferSize is 10
thread* Downloaderthreads = new thread[DownloaderThreadsNumber]; //DownloaderthreadsNumber = 1

Downloaderthreads[0] = thread(downloader,Pages,BufferSize,0);
Downloaderthreads[0].join();
delete[] Downloaderthreads;
delete[] Pages;
//downloader(Pages,BufferSize,0); This function call works for me!!!!
Last edited on Mar 29, 2017 at 7:18pm
Topic archived. No new replies allowed.