[DEV] work corectly with refcounting object (and remove some memory leek at close)

This commit is contained in:
2014-05-27 21:43:02 +02:00
parent 9b21e5c769
commit 3ec3fa00d9
33 changed files with 112 additions and 123 deletions

View File

@@ -25,7 +25,7 @@ namespace appl {
m_buffer(_buffer) {
};
~dataBufferStruct() { };
virtual ~dataBufferStruct() { };
};
};
@@ -51,7 +51,7 @@ class BufferView : public ewol::widget::List {
public:
// Constructeur
BufferView();
~BufferView();
virtual ~BufferView();
// Derived function
virtual void onReceiveMessage(const ewol::object::Message& _msg);
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _object);

View File

@@ -165,7 +165,7 @@ MainWindows::MainWindows() {
mySizerVert2->subWidgetAdd(myTextView);
*/
// search area :
ewol::object::Shared<Search> mySearch = ewol::object::makeShared(new Search());
ewol::object::Shared<appl::widget::Search> mySearch = ewol::object::makeShared(new appl::widget::Search());
mySizerVert2->subWidgetAdd(mySearch);
mySizerHori = ewol::object::makeShared(new ewol::widget::Sizer(ewol::widget::Sizer::modeHori));

View File

@@ -23,7 +23,7 @@ class MainWindows : public ewol::widget::Windows {
public:
// Constructeur
MainWindows();
~MainWindows();
virtual ~MainWindows();
private:
ewol::object::Shared<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
/**

View File

@@ -28,7 +28,7 @@ const char* const l_eventWrapCb = "appl-wrap-CheckBox";
const char* const l_eventForwardCb = "appl-forward-CheckBox";
const char* const l_eventHideBt = "appl-hide-button";
Search::Search() :
appl::widget::Search::Search() :
ewol::widget::Composer(ewol::widget::Composer::file, "DATA:GUI-Search.xml"),
m_viewerManager(NULL),
m_forward(true),
@@ -36,8 +36,8 @@ Search::Search() :
m_wrap(true),
m_searchEntry(NULL),
m_replaceEntry(NULL) {
addObjectType("appl::Search");
// load buffer manager:
addObjectType("appl::widget::Search");
// load buffer manager:onObjectRemove
m_viewerManager = appl::ViewerManager::keep();
// link event
registerOnEventNameWidget(this, "SEARCH:close", "pressed", l_eventHideBt);
@@ -63,11 +63,11 @@ Search::Search() :
hide();
}
Search::~Search() {
appl::widget::Search::~Search() {
}
void Search::find() {
void appl::widget::Search::find() {
if (m_viewerManager == NULL) {
APPL_WARNING("No viewer manager selected!!!");
return;
@@ -103,7 +103,7 @@ void Search::find() {
}
}
void Search::replace() {
void appl::widget::Search::replace() {
if (m_viewerManager == NULL) {
APPL_WARNING("No viewer manager selected!!!");
return;
@@ -121,7 +121,7 @@ void Search::replace() {
}
void Search::onReceiveMessage(const ewol::object::Message& _msg) {
void appl::widget::Search::onReceiveMessage(const ewol::object::Message& _msg) {
ewol::widget::Composer::onReceiveMessage(_msg);
APPL_INFO("Search receive message : " << _msg);
if ( _msg.getMessage() == l_eventSearchEntry) {
@@ -162,7 +162,7 @@ void Search::onReceiveMessage(const ewol::object::Message& _msg) {
}
}
void Search::onObjectRemove(const ewol::object::Shared<ewol::Object> _object) {
void appl::widget::Search::onObjectRemove(const ewol::object::Shared<ewol::Object>& _object) {
ewol::widget::Composer::onObjectRemove(_object);
if (_object == m_searchEntry) {
m_searchEntry.reset();

View File

@@ -14,35 +14,37 @@
#include <ewol/widget/Entry.h>
#include <appl/Buffer.h>
#include <appl/Gui/ViewerManager.h>
class Search : public ewol::widget::Composer {
private:
ewol::object::Shared<appl::ViewerManager> m_viewerManager; //!< handle on the buffer manager
bool m_forward;
bool m_caseSensitive;
bool m_wrap;
ewol::object::Shared<ewol::widget::Entry> m_searchEntry;
ewol::object::Shared<ewol::widget::Entry> m_replaceEntry;
std::u32string m_searchData;
std::u32string m_replaceData;
public:
// Constructeur
Search();
~Search();
private:
/**
* @brief Find the next element that corespond at the search
*/
void find();
/**
* @brief Replace the current selected text.
*/
void replace();
public: // derived function
virtual void onReceiveMessage(const ewol::object::Message& _msg);
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object> _removeObject);
namespace appl {
namespace widget {
class Search : public ewol::widget::Composer {
private:
ewol::object::Shared<appl::ViewerManager> m_viewerManager; //!< handle on the buffer manager
bool m_forward;
bool m_caseSensitive;
bool m_wrap;
ewol::object::Shared<ewol::widget::Entry> m_searchEntry;
ewol::object::Shared<ewol::widget::Entry> m_replaceEntry;
std::u32string m_searchData;
std::u32string m_replaceData;
public:
// Constructeur
Search();
virtual ~Search();
private:
/**
* @brief Find the next element that corespond at the search
*/
void find();
/**
* @brief Replace the current selected text.
*/
void replace();
public: // derived function
virtual void onReceiveMessage(const ewol::object::Message& _msg);
virtual void onObjectRemove(const ewol::object::Shared<ewol::Object>& _object);
};
};
};
#endif

View File

@@ -28,7 +28,7 @@ namespace appl {
fileLine(_line) {
};
~TagListElement() {
virtual ~TagListElement() {
};
};
@@ -44,7 +44,7 @@ namespace appl {
int32_t m_colorIdBackgroundSelected; //!< Color of line selected.
public:
TagFileList();
~TagFileList();
virtual ~TagFileList();
// display API :
virtual etk::Color<> getBasicBG();
uint32_t getNuberOfColomn();

View File

@@ -623,7 +623,7 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
ewol::widget::WidgetScrolled::onReceiveMessage(_msg);
APPL_VERBOSE("receive msg: " << _msg);
// First call plugin
if (appl::textPluginManager::onReceiveMessage(*this, _msg) == true) {
if (appl::textPluginManager::onReceiveMessageViewer(*this, _msg) == true) {
markToRedraw();
return;
}

View File

@@ -21,7 +21,7 @@ namespace appl {
protected:
ViewerManager();
public:
~ViewerManager();
virtual ~ViewerManager();
private:
ewol::object::Shared<appl::BufferManager> m_bufferManager; //!< handle on the buffer manager
ewol::object::Shared<appl::TextViewer> m_viewer;