[Bugfix] Fix of crash in TCanvas as suggested by Olivier Couet (#6576)
[Bugfix] Fix of crash in TCanvas as suggested by Olivier Couet (#6576)

* Fix of crash in TCanvas as suggested by Olivier Couet

* Implement suggestion from @couet

Co-authored-by: Andrii Verbytskyi <b50d31683e3de970dba9d421c4b09ed51761cb06@mppui4.t2.rzg.mpg.de>
Co-authored-by: Andrii Verbytskyi <234c4fba078292beef0e876b0590c0caf417a230@mpp.mpg.de>
root-mirror/root,root-mirror/root,root-mirror/root,olifre/root,root-mirror/root,olifre/root,olifre/root,olifre/root,olifre/root,root-mirror/root,root-mirror/root,olifre/root,root-mirror/root,olifre/root,olifre/root,olifre/root,olifre/root,root-mirror/root,olifre/root,root-mirror/root,root-mirror/root,root-mirror/root