Stop copying selected partition object in Information dialog (#750168)
When opening the Partition Information dialog, creation of the dialog object was creating a copy of the partition object to be displayed. If this was an extended partition it also included recursively constructing the contained logical partitions too. Instead, replace the partition object in the Dialog_Partition_Info class with a reference to it. NOTE: In C++ a reference is really just a pointer under the hood. As such, dereferences of a pointer to an object in the context of needing a reference to the object doesn't copy the object. It merely initialises the reference from the pointer. Specifically, with this prototype: Dialog_Partition_Info( const Partition & partition ); and the dialog object being constructed in Win_GParted::activate_info(): Dialog_Partition_Info dialog( *selected_partition_ptr ); the partition object is not copy constructed. A reference (pointer) to it is merely passed to the dialog constructor. Bug 750168 - Reduce the amount of copying of partition objects
parent
7f05037d
Please register or sign in to comment