// create font
rtn = __CreateFont(_DEFAULT_FONT_ENGINE, buffer.get(), fileLength, _DEFAULT_FONT_FACE, &pFont);
#endif
- std::auto_ptr<_IFont> autoPtrFont(pFont);
- SysTryReturnResult(NID_GRP, rtn && autoPtrFont.get() != null, E_UNSUPPORTED_FORMAT, "Failed to create _IFont instance");
+ SysTryReturnResult(NID_GRP, rtn && pFont != null, E_UNSUPPORTED_FORMAT, "Failed to create _IFont instance");
// make shared resource
- sharedFont.reset(autoPtrFont.release());
+ sharedFont.reset(pFont);
_IFont::Attrib fontAttrib;
rtn = pFont->GetAttrib(fontAttrib);
std::auto_ptr<ByteBuffer> pathString(pBuffer);
rtn = __CreateFont(_DEFAULT_FONT_ENGINE, (char*)pathString->GetPointer(), _DEFAULT_FONT_FACE, &pFont);
-
- std::auto_ptr<_IFont> autoPtrFont(pFont);
- SysTryReturnResult(NID_GRP, rtn && autoPtrFont.get() != null, E_UNSUPPORTED_FORMAT, "Failed to create _IFont instance");
+ SysTryReturnResult(NID_GRP, rtn && pFont != null, E_UNSUPPORTED_FORMAT, "Failed to create _IFont instance");
// make shared resource
- // ykahn: wrong use for a smart pointer
- sharedFont.reset(autoPtrFont.release());
+ sharedFont.reset(pFont);
_IFont::Attrib fontAttrib;
rtn = pFont->GetAttrib(fontAttrib);
// create new font with user resource.
//--------------------------------------------------------------------------
bool rtn = __CreateFont(_DEFAULT_FONT_ENGINE, pFontData, fontDataSize, _DEFAULT_FONT_FACE, &pFont);
- std::auto_ptr<_IFont> autoPtrFont(pFont);
- SysTryReturnResult(NID_GRP, rtn && autoPtrFont.get() != null, E_UNSUPPORTED_FORMAT, "Failed to create _IFont");
+ SysTryReturnResult(NID_GRP, rtn && pFont != null, E_UNSUPPORTED_FORMAT, "Failed to create _IFont");
// make shared resource
- sharedFont.reset(autoPtrFont.release());
+ sharedFont.reset(pFont);
_IFont::Attrib fontAttrib;
rtn = pFont->GetAttrib(fontAttrib);
rtn = __CreateFont(_DEFAULT_FONT_ENGINE, autoPtrBuffer.get(), fileLength, _DEFAULT_FONT_FACE, &pFont);
#endif
- std::auto_ptr<_IFont> autoPtrFont(pFont);
- SysTryReturnResult(NID_GRP, rtn && autoPtrFont.get() != null, E_UNSUPPORTED_FORMAT, "Failed to create _IFont instance");
+ SysTryReturnResult(NID_GRP, rtn && pFont != null, E_UNSUPPORTED_FORMAT, "Failed to create _IFont instance");
// make shared resource
- sharedFont.reset(autoPtrFont.release());
+ sharedFont.reset(pFont);
_IFont::Attrib fontAttrib;
rtn = pFont->GetAttrib(fontAttrib);