c++ - Delete or not after copy/load -



c++ - Delete or not after copy/load -

that's trick question, i'm not sure;

do have phone call delete after :

qimage::copy() qimage::load(qstring) qpixmap::fromimage(qimage)

by delete mean, deleting when don't need more.

qimage objects not special in how created , destroyed. on stack or new/delete or whatever, rules same c++ objects.

qimage implicitly shared, copying inexpensive (like shared pointer) performs copy-on-write preserve value semantics.

short story, don't ever have new/delete qimage, pass around value , quit worrying.

you don't have special deleting after calling copy/load methods, although might want assign my_image=qimage() release cached info or something.

c++ qt qimage

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -