- Timestamp:
- Aug 3, 2014, 1:44:02 PM (10 years ago)
- Location:
- trunk/BNC/src/PPP
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/PPP/pppClient.cpp
r5744 r5758 40 40 * -----------------------------------------------------------------------*/ 41 41 42 #include <QThreadStorage> 42 43 43 44 #include <iostream> … … 61 62 using namespace std; 62 63 63 // Global Variable 64 ////////////////////////////////////////////////////////////////////////////// 65 t_pppClient* PPP_CLIENT = 0; 64 // Global variable holding thread-specific pointers 65 ////////////////////////////////////////////////////////////////////////////// 66 QThreadStorage<t_pppClient*> CLIENTS; 67 68 // Static function returning thread-specific pointer 69 ////////////////////////////////////////////////////////////////////////////// 70 t_pppClient* t_pppClient::instance() { 71 return CLIENTS.localData(); 72 } 66 73 67 74 // Constructor … … 76 83 _staRover = new t_station(); 77 84 _filter = new t_filter(); 85 CLIENTS.setLocalData(this); 78 86 } 79 87 … … 81 89 ////////////////////////////////////////////////////////////////////////////// 82 90 t_pppClient::~t_pppClient() { 91 cout << "~t_pppClient" << endl; 83 92 delete _log; 84 93 delete _opt; -
trunk/BNC/src/PPP/pppClient.h
r5744 r5758 40 40 t_options* _opt; 41 41 42 static t_pppClient* instance(); 43 42 44 private: 43 45 void initOutput(t_output* output); … … 67 69 }; // namespace BNC 68 70 69 // / Pointer to the main object70 extern BNC::t_pppClient* PPP_CLIENT; 71 // Pointer to the main object (thread-specific) 72 #define PPP_CLIENT (BNC::t_pppClient::instance()) 71 73 72 // /Log stream abbreviation74 // Log stream abbreviation 73 75 #define LOG (*PPP_CLIENT->_log) 74 76 75 // /Options abbreviation77 // Options abbreviation 76 78 #define OPT (PPP_CLIENT->_opt) 77 79 -
trunk/BNC/src/PPP/pppThread.cpp
r5742 r5758 110 110 //////////////////////////////////////////////////////////////////////////// 111 111 t_pppRun::~t_pppRun() { 112 delete _pppClient;112 //// delete _pppClient; 113 113 cout << "~t_pppRun" << endl; 114 114 }
Note:
See TracChangeset
for help on using the changeset viewer.