mercredi 13 juillet 2016

Accessing struct member through unique_ptr gives segmentation fault


This is how I set pointer to struct. At runtime segmentation fault is thrown at second line. LoadedPDFInfo is struct in Canvas namespace

struct std::unique_ptr<Canvas::LoadedPDFInfo> pdfInfo;
pdfInfo->handle = ++currentPDFHandle;
pdfInfo->totalPageNum = FPDF_GetPageCount(doc);

Aucun commentaire:

Enregistrer un commentaire