use a shared pointer for more elegant cleanup at assignment conclusion
Merge pull request #2570 from birarda/shared-assignment-pointer

use a QSharedPointer to allow for more elegant assignment cleanup