Page 1 of 1

QPrintPreviewDialog and QPrintDialog documentation issue

Posted: Fri Nov 25 2022 4:34 pm
by seasoned_geek
Neither of these classes state what happens with the ownership of object pointed to by QPrinter * passed in constructor.

https://www.copperspice.com/docs/cs_api/class_qprintpreviewdialog.html#ae66d852b5d53214cc1188ad557858536
https://www.copperspice.com/docs/cs_api/class_qprintdialog.html#ae6c360c77aa86aa9c6ac1ce43f744c24

It's important to know this because if ownership of non-parented object does get transferred then said object cannot be created on the stack. It appears QPrintPreviewDialog attempts to take ownership, which leads to this.

Code: Select all

free(): double free detected in tcache 2