Skip to content

Commit

Permalink
Fix segfault when deleting scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulh committed Mar 12, 2013
1 parent 7d91723 commit 596b48b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ void GenlistItemScenarioSchedule::initView()

void GenlistItemScenarioSchedule::updateView()
{
if (!io) return;

if (scenario->ioScenario)
{
elm_genlist_item_fields_update(item, "text", ELM_GENLIST_ITEM_FIELD_TEXT);
Expand Down Expand Up @@ -223,7 +225,7 @@ void GenlistItemScenarioSchedule::scenarioDelete(void *data)

_item = new GenlistItemSimple(evas, parent, "Non", true);
_item->Append(glist, header);
_item->item_selected.connect(sigc::mem_fun(*this, &GenlistItemScenarioSchedule::deleteScenarioCancel));
_item->item_selected.connect(sigc::bind(sigc::mem_fun(*this, &GenlistItemScenarioSchedule::deleteScenarioCancel), _item));

elm_table_pack(table, glist, 1, 1, 1, 1);

Expand All @@ -238,11 +240,12 @@ void GenlistItemScenarioSchedule::deleteScenarioValid(void *data)
elm_ctxpopup_dismiss(popup);
}

void GenlistItemScenarioSchedule::deleteScenarioCancel(void *data)
void GenlistItemScenarioSchedule::deleteScenarioCancel(void *data, GenlistItemSimple *cancel_item)
{
if (!scenario) return;

elm_ctxpopup_dismiss(popup);
elm_naviframe_item_pop(pager_popup);
cancel_item->setSelected(false);
}

void GenlistItemScenarioSchedule::scenarioModify(void *data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

using namespace Utils;

class GenlistItemSimple;
class GenlistItemScenarioSchedule: public GenlistItemBase, public IOBaseElement
{
private:
Expand All @@ -45,7 +46,7 @@ class GenlistItemScenarioSchedule: public GenlistItemBase, public IOBaseElement
virtual void ioDeleted();

void deleteScenarioValid(void *data);
void deleteScenarioCancel(void *data);
void deleteScenarioCancel(void *data, GenlistItemSimple *cancel_item);

public:
GenlistItemScenarioSchedule(Evas *evas, Evas_Object *parent, bool scheduleView, Scenario *scenario, void *data = NULL);
Expand Down

0 comments on commit 596b48b

Please sign in to comment.