
Originally Posted by
Lykurg
Hi,
have you only substitute "struct" through "class"? No other change at all? How does the structure of the new class look like?
best
You may see by yourself (only relevant data displayed):
//Old struct-based:
struct periodical_data
{
QList<time_frame> baseData;
QList<figure_congestion_rectangular> rectangles;
QList<figure_congestion_triangles> triangles;
QList<figure_channels> channels;
QList<basic_price_value> zig_zag_sequence;
QList<pivot> pivots;
};
struct share //Structure that contains all data about a share
{
periodical_data periodicity[PERIOD_MAX];
};
//Old struct-based:
struct periodical_data
{
QList<time_frame> baseData;
QList<figure_congestion_rectangular> rectangles;
QList<figure_congestion_triangles> triangles;
QList<figure_channels> channels;
QList<basic_price_value> zig_zag_sequence;
QList<pivot> pivots;
};
struct share //Structure that contains all data about a share
{
periodical_data periodicity[PERIOD_MAX];
};
To copy to clipboard, switch view to plain text mode
vs.
//New class-based:
struct periodical_data
{
QList<time_frame> baseData;
QList<figure_congestion_rectangular> rectangles;
QList<figure_congestion_triangles> triangles;
QList<figure_channels> channels;
QList<basic_price_value> zig_zag_sequence;
QList<pivot> pivots;
};
class share //Class that contains all data about a share
{
public:
explicit share() { /*does nothing*/ }
~share(); //does nothing
private:
periodical_data periodicity[PERIOD_MAX];
};
//New class-based:
struct periodical_data
{
QList<time_frame> baseData;
QList<figure_congestion_rectangular> rectangles;
QList<figure_congestion_triangles> triangles;
QList<figure_channels> channels;
QList<basic_price_value> zig_zag_sequence;
QList<pivot> pivots;
};
class share //Class that contains all data about a share
{
public:
explicit share() { /*does nothing*/ }
~share(); //does nothing
private:
periodical_data periodicity[PERIOD_MAX];
};
To copy to clipboard, switch view to plain text mode
Added after 8 minutes:

Originally Posted by
ChrisW67
Deleting a serious number of heap allocated objects might take some time especially if their destructor does something significant...
...
It might be the orderly teardown of network or database connections.
Well Chris, I wouln't be surprised if my software took some time to exit given the amount of data I load. The strange thing is that this problem didn't exist when I used structs, but it appeared when I changed it to classes. But nope, my destructor actually don't do anything. No database connections either or network issues; the only thing is the data I load from .csv files into my objects. When this is not performed, the app closes in normal speed, so to speak.
Bookmarks