Android Bug Fixed but not Fixed?
by Chase Webb · in Torque 2D Beginner · 08/20/2014 (8:06 am) · 4 replies
To be brief:
Line 164 of / engine / source / console / consoleNamespace.cc says this:
At one point it was fixed to:
But later it was reverted. It needs to be fixed again to prevent crashing.
/salutes
(Thanks to practicing01 for helping me figure this out)
Line 164 of / engine / source / console / consoleNamespace.cc says this:
AssertFatal(mRefCountToParent > 0, "Namespace::unlinkClass - reference count to parent is less than 0");
At one point it was fixed to:
AssertFatal(mRefCountToParent >= 0, "Namespace::unlinkClass - reference count to parent is less than 0");
But later it was reverted. It needs to be fixed again to prevent crashing.
/salutes
(Thanks to practicing01 for helping me figure this out)
#2
I spent a not-so-insignificant amount of time investigating this recently. Although T2D and T3D share the SimObject class, the T3D version has better namespace code. So the long term solution to transplant that code (minus the package stuff) into T2D.
08/21/2014 (9:32 am)
I can't imagine this being an Android only problem since namespaces are a core function of SimObjects. Are you using the latest version of the engine Chase? In any case, there are big issues with how T2D handles namespaces for class, superclass, and object names. Short term solution: use behaviors. :)I spent a not-so-insignificant amount of time investigating this recently. Although T2D and T3D share the SimObject class, the T3D version has better namespace code. So the long term solution to transplant that code (minus the package stuff) into T2D.
#3
08/22/2014 (11:45 pm)
I am using the most latest version of the Dev branch, yes. My project runs fine on my Windows system (no errors in the log and no crashes), but getting it to work on Android has been one wall after another. In this case, once the little workaround that practicing provided me is implemented I can actually get the project to load in debug mode on my phone (a Galaxy S4 variant), though there are sizing problems and the text is all missing and it crashes soon after. If I don't change the code above it crashes while trying to load the app.
#4
The reason why it should be mRefCountToParent > 0 and not mRefCountToParent >= 0 is because mRefCountToParent is an unsigned integer, so it can never be less than zero. The >= 0 was pointless as the condition would always be true, it would have been just as effective to delete that assert.
The way I have it in my pull request, at least you get a warning in the console if you're somehow trying to unlink a namespace without a parent.
08/23/2014 (6:56 am)
I just submitted a pull request that should fix the namespace issues behind the problem highlighted in the first post. I left the assert in but changed it to warn instead of fatal. The reason why it should be mRefCountToParent > 0 and not mRefCountToParent >= 0 is because mRefCountToParent is an unsigned integer, so it can never be less than zero. The >= 0 was pointless as the condition would always be true, it would have been just as effective to delete that assert.
The way I have it in my pull request, at least you get a warning in the console if you're somehow trying to unlink a namespace without a parent.
Torque Owner practicing01
MourningDoveSoft