#include "frontends/alert.h"
#include "frontends/Application.h"
+#include "support/bind.h"
#include "support/ConsoleApplication.h"
#include "support/lassert.h"
#include "support/debug.h"
#include "support/Messages.h"
#include "support/os.h"
#include "support/Package.h"
-
-#include "support/bind.h"
-#include <boost/scoped_ptr.hpp>
+#include "support/unique_ptr.h"
#include <algorithm>
#include <iostream>
///
CmdDef toplevel_cmddef_;
///
- boost::scoped_ptr<Server> lyx_server_;
+ unique_ptr<Server> lyx_server_;
///
- boost::scoped_ptr<ServerSocket> lyx_socket_;
+ unique_ptr<ServerSocket> lyx_socket_;
///
- boost::scoped_ptr<frontend::Application> application_;
+ unique_ptr<frontend::Application> application_;
/// lyx session, containing lastfiles, lastfilepos, and lastopened
- boost::scoped_ptr<Session> session_;
+ unique_ptr<Session> session_;
/// Files to load at start.
vector<string> files_to_load_;
Buffer * buf = pimpl_->buffer_list_.newBuffer(fname.absFileName());
LYXERR(Debug::FILES, "Loading " << fname);
- if (buf->loadLyXFile() == Buffer::ReadSuccess) {
+ if (buf && buf->loadLyXFile() == Buffer::ReadSuccess) {
ErrorList const & el = buf->errorList("Parse");
if (!el.empty())
for_each(el.begin(), el.end(),
bind(&LyX::printError, this, _1));
command_line_buffers.push_back(buf);
} else {
- pimpl_->buffer_list_.release(buf);
+ if (buf)
+ pimpl_->buffer_list_.release(buf);
docstring const error_message =
bformat(_("LyX failed to load the following file: %1$s"),
from_utf8(fname.absFileName()));
// FIXME: this should not be use_gui dependent
LWARNIF(use_gui);
LAPPERR(singleton_);
- return *singleton_->pimpl_->lyx_server_.get();
+ return *singleton_->pimpl_->lyx_server_;
}
// FIXME: this should not be use_gui dependent
LWARNIF(use_gui);
LAPPERR(singleton_);
- return *singleton_->pimpl_->lyx_socket_.get();
+ return *singleton_->pimpl_->lyx_socket_;
}