Skip to content

Commit

Permalink
Minor Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AdventureT committed Dec 7, 2023
1 parent b0357d9 commit 00e00e2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
12 changes: 11 additions & 1 deletion Tools/UnitTests/Source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ TOSHI_NAMESPACE_USING

class AApplication : public Toshi::TApplication
{
virtual TBOOL OnCreate(TINT argc, TPCHAR* const argv) override
{
return TApplication::OnCreate(argc, argv);
}

virtual TBOOL OnUpdate(TFLOAT a_fDelta)
{
// Skip Updating
return TFALSE;
}
};

static AApplication g_oTheApp;
Expand All @@ -13,7 +23,7 @@ int main(int argc, char* argv[])
{
int result;
if (g_oTheApp.Create("UnitTests", argc, argv)) {
//g_oTheApp.Execute();
g_oTheApp.Execute();
result = Catch::Session().run(argc, argv);
}

Expand Down
1 change: 1 addition & 0 deletions Toshi/Include/TKernel/TNodeTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class TNodeTree
// Check if the node belongs to the current tree
if (nodeRoot != this)
{
TASSERT(!"A node is being removed from a different tree from it's current tree.");
return &node;
}

Expand Down
16 changes: 15 additions & 1 deletion Toshi/Source/TKernel/TTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@ IMPLEMENT_DYNAMIC(TTask, TObject);
TBOOL TTask::Create()
{
TASSERT(IsCreated()==TFALSE);
return TBOOL();
if (!IsCreated()) {
if (!OnCreate()) {
OnDestroy();
m_Tree->Remove(this, TFALSE);
Delete();

return TFALSE;
}

//auto oldState = m_State;
//m_State |= State_Created;
//Activate(TTRUE);
}

return TTRUE;
}

TBOOL TTask::CreateFailed()
Expand Down

0 comments on commit 00e00e2

Please sign in to comment.