Ignore:
Timestamp:
May 19, 2013, 9:20:51 AM (6 years ago)
Author:
cameron
Message:

Fixes for icXML 0.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icXML/icXML-devel/src/xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp

    r2777 r3157  
    3131#include <xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.hpp>
    3232#include <xercesc/util/MsgLoaders/InMemory/XercesMessages_en_US.hpp>
     33#include <xercesc/util/Janitor.hpp>
    3334
    3435XERCES_CPP_NAMESPACE_BEGIN
     
    146147    //  which will do the replacement work.
    147148    //
    148     XMLCh* tmp1 = 0;
    149     XMLCh* tmp2 = 0;
    150     XMLCh* tmp3 = 0;
    151     XMLCh* tmp4 = 0;
    152    
    153     bool bRet = false;
     149
     150    Janitor<XMLCh> janRepText1(0);
     151    Janitor<XMLCh> janRepText2(0);
     152    Janitor<XMLCh> janRepText3(0);
     153    Janitor<XMLCh> janRepText4(0);
     154
    154155    if (repText1)
    155         tmp1 = XMLString::transcode(repText1, manager);
     156        janRepText1.reset(XMLString::transcode(repText1, manager));
    156157    if (repText2)
    157         tmp2 = XMLString::transcode(repText2, manager);
     158        janRepText2.reset(XMLString::transcode(repText2, manager));
    158159    if (repText3)
    159         tmp3 = XMLString::transcode(repText3, manager);
     160        janRepText3.reset(XMLString::transcode(repText3, manager));
    160161    if (repText4)
    161         tmp4 = XMLString::transcode(repText4, manager);
     162        janRepText4.reset(XMLString::transcode(repText4, manager));
    162163
    163     bRet = loadMsg(msgToLoad, toFill, maxChars, tmp1, tmp2, tmp3, tmp4, manager);
    164 
    165     if (tmp1)
    166         manager->deallocate(tmp1);//delete [] tmp1;
    167     if (tmp2)
    168         manager->deallocate(tmp2);//delete [] tmp2;
    169     if (tmp3)
    170         manager->deallocate(tmp3);//delete [] tmp3;
    171     if (tmp4)
    172         manager->deallocate(tmp4);//delete [] tmp4;
    173 
    174     return bRet;
     164    return loadMsg(msgToLoad, toFill, maxChars, janRepText1.get(), janRepText2.get(), janRepText3.get(), janRepText4.get(), manager);
    175165}
    176166
Note: See TracChangeset for help on using the changeset viewer.