I am fairly new to C++. Could someone tell me if following code is safe.
someButton = new MyCustomButton(myPixmap,this);
MyCustomButton::MyCustomButton(const QPixmap &pixmap, QWidget *parent)
: QWidget(parent), m_pixmap (pixmap)
m_pixmap = pixmap;
class MyCustomButton: public QWidget
I am worried that the pixmap data is corrupted, because it is allocated from the stack, not heap. Does the MyCustomButton instance make a copy of the pixmap when instance is constructed?