summaryrefslogtreecommitdiff
path: root/indra/llcharacter
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcharacter')
-rw-r--r--indra/llcharacter/llbvhloader.cpp9
-rw-r--r--indra/llcharacter/llkeyframemotionparam.cpp7
-rw-r--r--indra/llcharacter/llstatemachine.cpp6
3 files changed, 13 insertions, 9 deletions
diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp
index 7b53de06b9..e1f8ce53fb 100644
--- a/indra/llcharacter/llbvhloader.cpp
+++ b/indra/llcharacter/llbvhloader.cpp
@@ -178,7 +178,9 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
//--------------------------------------------------------------------
std::string path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,fileName);
- apr_file_t *fp = ll_apr_file_open(path, LL_APR_R);
+ LLAPRFile infile ;
+ infile.open(path, LL_APR_R);
+ apr_file_t *fp = infile.getFileHandle();
if (!fp)
return ST_NO_XLT_FILE;
@@ -187,8 +189,7 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
//--------------------------------------------------------------------
// register file to be closed on function exit
//--------------------------------------------------------------------
- FileCloser fileCloser(fp);
-
+
//--------------------------------------------------------------------
// load header
//--------------------------------------------------------------------
@@ -618,6 +619,8 @@ LLBVHLoader::Status LLBVHLoader::loadTranslationTable(const char *fileName)
}
}
+
+ infile.close() ;
return ST_OK;
}
diff --git a/indra/llcharacter/llkeyframemotionparam.cpp b/indra/llcharacter/llkeyframemotionparam.cpp
index c0af6250c2..a9c1f6fc45 100644
--- a/indra/llcharacter/llkeyframemotionparam.cpp
+++ b/indra/llcharacter/llkeyframemotionparam.cpp
@@ -354,7 +354,9 @@ BOOL LLKeyframeMotionParam::loadMotions()
// open the file
//-------------------------------------------------------------------------
S32 fileSize = 0;
- apr_file_t* fp = ll_apr_file_open(path, LL_APR_R, &fileSize);
+ LLAPRFile infile ;
+ infile.open(path, LL_APR_R, NULL, &fileSize);
+ apr_file_t* fp = infile.getFileHandle() ;
if (!fp || fileSize == 0)
{
llinfos << "ERROR: can't open: " << path << llendl;
@@ -366,7 +368,6 @@ BOOL LLKeyframeMotionParam::loadMotions()
if ( !text )
{
llinfos << "ERROR: can't allocated keyframe text buffer." << llendl;
- apr_file_close(fp);
return FALSE;
}
@@ -393,7 +394,7 @@ BOOL LLKeyframeMotionParam::loadMotions()
//-------------------------------------------------------------------------
// close the file
//-------------------------------------------------------------------------
- apr_file_close( fp );
+ infile.close();
//-------------------------------------------------------------------------
// check for error
diff --git a/indra/llcharacter/llstatemachine.cpp b/indra/llcharacter/llstatemachine.cpp
index 5a2faf6e71..73c6951211 100644
--- a/indra/llcharacter/llstatemachine.cpp
+++ b/indra/llcharacter/llstatemachine.cpp
@@ -209,7 +209,9 @@ LLFSMState* LLStateDiagram::getState(U32 state_id)
BOOL LLStateDiagram::saveDotFile(const std::string& filename)
{
- apr_file_t* dot_file = ll_apr_file_open(filename, LL_APR_W);
+ LLAPRFile outfile ;
+ outfile.open(filename, LL_APR_W);
+ apr_file_t* dot_file = outfile.getFileHandle() ;
if (!dot_file)
{
@@ -258,8 +260,6 @@ BOOL LLStateDiagram::saveDotFile(const std::string& filename)
apr_file_printf(dot_file, "}\n");
- apr_file_close(dot_file);
-
return TRUE;
}