This is fine, but the class will take ownership of this heap-allocated variable, and therefore it won't get deleted until the algorithm is destroyed (presumably at program exit). Better to give it a NULL parent in this case and delete at the end of the function, a perfect scenario for a QScopedPointer ;)