From: Guillem Jover <gjover@sipwise.com>
Date: Fri, 25 Aug 2017 14:13:08 +0200
Subject: [PATCH] apps: Switch from auto_ptr to unique_ptr
Fixes: commit 0c3dece6e7faa65d3214f566a01d74273dc23700
diff --git a/apps/announcement/Announcement.h b/apps/announcement/Announcement.h
index b07b045c..6aabb9c9 100644
--- a/apps/announcement/Announcement.h
+++ b/apps/announcement/Announcement.h
@@ -63,7 +63,7 @@ class AnnouncementDialog : public AmSession,
AmAudioFile wav_file;
string filename;
- std::auto_ptr<UACAuthCred> cred;
+ std::unique_ptr<UACAuthCred> cred;
public:
AnnouncementDialog(const string& filename,
UACAuthCred* credentials = NULL);
diff --git a/apps/examples/cacheannounce/CacheAnnounce.h b/apps/examples/cacheannounce/CacheAnnounce.h
index ba2b550e..b0f403e0 100644
--- a/apps/examples/cacheannounce/CacheAnnounce.h
+++ b/apps/examples/cacheannounce/CacheAnnounce.h
@@ -33,7 +33,7 @@
#include "AmCachedAudioFile.h"
#include <memory>
-using std::auto_ptr;
+using std::unique_ptr;
#include <string>
using std::string;
@@ -56,7 +56,7 @@ public:
class CacheAnnounceDialog : public AmSession
{
- auto_ptr<AmCachedAudioFile> wav_file;
+ unique_ptr<AmCachedAudioFile> wav_file;
AmFileCache* announce;
public:
diff --git a/apps/examples/dtmftester/DtmfTester.h b/apps/examples/dtmftester/DtmfTester.h
index e5856aec..41b5b8ad 100644
--- a/apps/examples/dtmftester/DtmfTester.h
+++ b/apps/examples/dtmftester/DtmfTester.h
@@ -66,7 +66,7 @@ class DtmfTesterDialog : public AmSession,
AmPlaylist play_list;
- std::auto_ptr<UACAuthCred> cred;
+ std::unique_ptr<UACAuthCred> cred;
vector<AmAudioFile*> del_files;
diff --git a/apps/examples/early_record/EarlyRecord.h b/apps/examples/early_record/EarlyRecord.h
index 3f4636ac..47de9c7a 100644
--- a/apps/examples/early_record/EarlyRecord.h
+++ b/apps/examples/early_record/EarlyRecord.h
@@ -30,7 +30,7 @@ class EarlyRecordDialog
string msg_filename;
AmAudioFile a_msg;
- std::auto_ptr<UACAuthCred> cred;
+ std::unique_ptr<UACAuthCred> cred;
protected:
void process(AmEvent* event);
diff --git a/apps/examples/jukecall/Jukecall.h b/apps/examples/jukecall/Jukecall.h
index fd018a01..576a7631 100644
--- a/apps/examples/jukecall/Jukecall.h
+++ b/apps/examples/jukecall/Jukecall.h
@@ -62,7 +62,7 @@ private:
JukeLeg1_state state;
AmAudioFile initial_announcement;
- auto_ptr<AmAudioFile> song;
+ unique_ptr<AmAudioFile> song;
protected:
AmB2ABCalleeSession* createCalleeSession();
@@ -82,7 +82,7 @@ class JukecalleeSession
: public AmB2ABCalleeSession {
void process(AmEvent* event);
- auto_ptr<AmAudioFile> song;
+ unique_ptr<AmAudioFile> song;
public:
JukecalleeSession(const string& other_tag,
diff --git a/apps/examples/pinauthconference/PinAuthConference.h b/apps/examples/pinauthconference/PinAuthConference.h
index a959d88f..108a65bd 100644
--- a/apps/examples/pinauthconference/PinAuthConference.h
+++ b/apps/examples/pinauthconference/PinAuthConference.h
@@ -84,7 +84,7 @@ private:
AmPromptCollection& prompts;
// our connection to the conference
- auto_ptr<AmConferenceChannel> channel;
+ unique_ptr<AmConferenceChannel> channel;
string conf_id;
string pin_str;
diff --git a/apps/examples/simple_conference/SimpleConference.h b/apps/examples/simple_conference/SimpleConference.h
index 69411b6c..7c80c245 100644
--- a/apps/examples/simple_conference/SimpleConference.h
+++ b/apps/examples/simple_conference/SimpleConference.h
@@ -58,14 +58,14 @@ class SimpleConferenceDialog : public AmSession
{
string conf_id;
// our connection to the conference
- auto_ptr<AmConferenceChannel> channel;
+ unique_ptr<AmConferenceChannel> channel;
// we use a playlist so we can put e.g.
// announcement files to be played to the
// user in front and after its finished we will
// be connected back to conference automatically
AmPlaylist play_list;
- auto_ptr<AmAudioFile> BeepSound;
+ unique_ptr<AmAudioFile> BeepSound;
public:
diff --git a/apps/rtmp/RtmpConnection.cpp b/apps/rtmp/RtmpConnection.cpp
index b256e891..3caebf55 100644
--- a/apps/rtmp/RtmpConnection.cpp
+++ b/apps/rtmp/RtmpConnection.cpp
@@ -669,7 +669,7 @@ void RtmpConnection::rxAudio(RTMPPacket *packet)
RtmpSession* RtmpConnection::startSession(const char* uri)
{
- auto_ptr<RtmpSession> n_session(new RtmpSession(this));
+ unique_ptr<RtmpSession> n_session(new RtmpSession(this));
AmSipDialog* dialout_dlg = n_session->dlg;
string dialout_id = AmSession::getNewId();