mirror of
https://github.com/audacity/linuxdeploy.git
synced 2026-05-04 07:13:31 -05:00
Use shared pointer to manage PImpl object
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// system includes
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
// library includes
|
||||
@@ -19,7 +20,7 @@ namespace linuxdeploy {
|
||||
private:
|
||||
// private data class pattern
|
||||
class PrivateData;
|
||||
PrivateData* d;
|
||||
std::shared_ptr<PrivateData> d;
|
||||
|
||||
public:
|
||||
// default constructor
|
||||
|
||||
@@ -532,15 +532,11 @@ namespace linuxdeploy {
|
||||
};
|
||||
|
||||
AppDir::AppDir(const bf::path& path) {
|
||||
d = new PrivateData();
|
||||
d = std::make_shared<PrivateData>();
|
||||
|
||||
d->appDirPath = path;
|
||||
}
|
||||
|
||||
AppDir::~AppDir() {
|
||||
delete d;
|
||||
}
|
||||
|
||||
AppDir::AppDir(const std::string& path) : AppDir(bf::path(path)) {}
|
||||
|
||||
bool AppDir::createBasicStructure() {
|
||||
|
||||
Reference in New Issue
Block a user