summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp47
1 files changed, 24 insertions, 23 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 36a8b41d8b..ecfd101eeb 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1177,7 +1177,7 @@ bool LLAppViewer::mainLoop()
//-------------------------------------------
// Create IO Pump to use for HTTP Requests.
- gServicePump = new LLPumpIO;
+ gServicePump = new LLPumpIO(gAPRPoolp);
LLHTTPClient::setPump(*gServicePump);
LLCurl::setCAFile(gDirUtilp->getCAFile());
@@ -1537,16 +1537,16 @@ bool LLAppViewer::cleanup()
}
// *TODO - generalize this and move DSO wrangling to a helper class -brad
- for(std::map<apr_dso_handle_t*, boost::shared_ptr<LLAPRPool> >::iterator plugin = mPlugins.begin();
- plugin != mPlugins.end(); ++plugin)
+ std::set<struct apr_dso_handle_t *>::const_iterator i;
+ for(i = mPlugins.begin(); i != mPlugins.end(); ++i)
{
int (*ll_plugin_stop_func)(void) = NULL;
- apr_status_t rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll_plugin_stop_func, plugin->first, "ll_plugin_stop");
+ apr_status_t rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll_plugin_stop_func, *i, "ll_plugin_stop");
ll_plugin_stop_func();
- rv = apr_dso_unload(plugin->first);
+ rv = apr_dso_unload(*i);
}
- mPlugins.clear(); // Forget handles and destroy all memory pools.
+ mPlugins.clear();
//flag all elements as needing to be destroyed immediately
// to ensure shutdown order
@@ -1984,7 +1984,7 @@ bool LLAppViewer::initThreads()
if (LLFastTimer::sLog || LLFastTimer::sMetricLog)
{
- LLFastTimer::sLogLock = new LLMutex;
+ LLFastTimer::sLogLock = new LLMutex(NULL);
mFastTimerLogThread = new LLFastTimerLogThread(LLFastTimer::sLogName);
mFastTimerLogThread->start();
}
@@ -3222,7 +3222,8 @@ void LLAppViewer::handleViewerCrash()
else crash_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,ERROR_MARKER_FILE_NAME);
llinfos << "Creating crash marker file " << crash_file_name << llendl;
- LLAPRFile crash_file(crash_file_name, LL_APR_W);
+ LLAPRFile crash_file ;
+ crash_file.open(crash_file_name, LL_APR_W);
if (crash_file.getFileHandle())
{
LL_INFOS("MarkerFile") << "Created crash marker file " << crash_file_name << LL_ENDL;
@@ -3286,10 +3287,11 @@ bool LLAppViewer::anotherInstanceRunning()
LL_DEBUGS("MarkerFile") << "Checking marker file for lock..." << LL_ENDL;
//Freeze case checks
- if (LLAPRFile::isExist(marker_file, LL_APR_RB))
+ if (LLAPRFile::isExist(marker_file, NULL, LL_APR_RB))
{
// File exists, try opening with write permissions
- LLAPRFile outfile(marker_file, LL_APR_WB);
+ LLAPRFile outfile ;
+ outfile.open(marker_file, LL_APR_WB);
apr_file_t* fMarker = outfile.getFileHandle() ;
if (!fMarker)
{
@@ -3328,25 +3330,25 @@ void LLAppViewer::initMarkerFile()
std::string llerror_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, LLERROR_MARKER_FILE_NAME);
std::string error_marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ERROR_MARKER_FILE_NAME);
- if (LLAPRFile::isExist(mMarkerFileName, LL_APR_RB) && !anotherInstanceRunning())
+ if (LLAPRFile::isExist(mMarkerFileName, NULL, LL_APR_RB) && !anotherInstanceRunning())
{
gLastExecEvent = LAST_EXEC_FROZE;
LL_INFOS("MarkerFile") << "Exec marker found: program froze on previous execution" << LL_ENDL;
}
- if(LLAPRFile::isExist(logout_marker_file, LL_APR_RB))
+ if(LLAPRFile::isExist(logout_marker_file, NULL, LL_APR_RB))
{
gLastExecEvent = LAST_EXEC_LOGOUT_FROZE;
LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL;
LLAPRFile::remove(logout_marker_file);
}
- if(LLAPRFile::isExist(llerror_marker_file, LL_APR_RB))
+ if(LLAPRFile::isExist(llerror_marker_file, NULL, LL_APR_RB))
{
if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH;
else gLastExecEvent = LAST_EXEC_LLERROR_CRASH;
LL_INFOS("MarkerFile") << "Last exec LLError crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL;
LLAPRFile::remove(llerror_marker_file);
}
- if(LLAPRFile::isExist(error_marker_file, LL_APR_RB))
+ if(LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB))
{
if(gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) gLastExecEvent = LAST_EXEC_LOGOUT_CRASH;
else gLastExecEvent = LAST_EXEC_OTHER_CRASH;
@@ -3362,7 +3364,7 @@ void LLAppViewer::initMarkerFile()
// Create the marker file for this execution & lock it
apr_status_t s;
- s = mMarkerFile.open(mMarkerFileName, LL_APR_W, LLAPRFile::long_lived);
+ s = mMarkerFile.open(mMarkerFileName, LL_APR_W, TRUE);
if (s == APR_SUCCESS && mMarkerFile.getFileHandle())
{
@@ -4588,7 +4590,8 @@ void LLAppViewer::sendLogoutRequest()
gLogoutInProgress = TRUE;
mLogoutMarkerFileName = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,LOGOUT_MARKER_FILE_NAME);
- LLAPRFile outfile(mLogoutMarkerFileName, LL_APR_W);
+ LLAPRFile outfile ;
+ outfile.open(mLogoutMarkerFileName, LL_APR_W);
mLogoutMarkerFile = outfile.getFileHandle() ;
if (mLogoutMarkerFile)
{
@@ -5040,15 +5043,14 @@ void LLAppViewer::loadEventHostModule(S32 listen_port)
}
#endif // LL_WINDOWS
- boost::shared_ptr<LLAPRPool> eventhost_dso_memory_pool_ptr(new LLAPRPool);
- LLAPRPool& eventhost_dso_memory_pool(*eventhost_dso_memory_pool_ptr);
- apr_dso_handle_t* eventhost_dso_handle = NULL;
+ apr_dso_handle_t * eventhost_dso_handle = NULL;
+ apr_pool_t * eventhost_dso_memory_pool = NULL;
//attempt to load the shared library
- eventhost_dso_memory_pool.create();
+ apr_pool_create(&eventhost_dso_memory_pool, NULL);
apr_status_t rv = apr_dso_load(&eventhost_dso_handle,
dso_path.c_str(),
- eventhost_dso_memory_pool());
+ eventhost_dso_memory_pool);
llassert_always(! ll_apr_warn_status(rv, eventhost_dso_handle));
llassert_always(eventhost_dso_handle != NULL);
@@ -5068,8 +5070,7 @@ void LLAppViewer::loadEventHostModule(S32 listen_port)
llerrs << "problem loading eventhost plugin, status: " << status << llendl;
}
- // Store the handle and link it to the pool that was used to allocate it.
- mPlugins[eventhost_dso_handle] = eventhost_dso_memory_pool_ptr;
+ mPlugins.insert(eventhost_dso_handle);
}
void LLAppViewer::launchUpdater()