Comments (5)
I had forgot about this one. Tackling it on 0.2.2.4, since I had to postpone the release for further testing Procedural Parts, as agreed on KSP-CKAN/NetKAN#9076 .
from ksp-recall.
This problem is COMPLETELY unrelated to KSP-Recall or TweakScale. On a KSP 1.12.3 without any of them, this exception also happened:
[LOG 20:05:21.374] PartLoader: Compiling Part 'REPOSoftTech/DeepFreeze/Parts/CRY0300Freezer/CRY-0300Freezer'
[LOG 20:05:21.401] DeepFreezer OnDestroy
[EXC 20:05:21.409] NullReferenceException: Object reference not set to an instance of an object
DF.DeepFreezer.OnDestroy () (at <72233efaa3ee4936a15201f98fac7b68>:0)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
KSPe.Util.Log.UnityLogDecorator:UnityEngine.ILogHandler.LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Object:DestroyImmediate(Object)
PartLoader:StripComponent(GameObject)
PartLoader:CreatePartIcon(GameObject, Single&)
PartLoader:ParsePart(UrlConfig, ConfigNode)
<CompileParts>d__56:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
Checking on the Deep Freeze [source code](https://github.com/JPLRepo/DeepFreeze/blob/9f509f75f1da3f79684b309da69c340c46bfa003/Source/DeepFreeze.cs#L214
):
protected void OnDestroy()
{
Utilities.Log("OnDestroy");
Instance = null;
APIReady = false;
foreach (Component child in children)
{
Utilities.Log("DeepFreeze Child Destroy for " + child.name);
Destroy(child);
}
children.Clear();
DeepFreezeEventRem();
GameEvents.onGameSceneLoadRequested.Remove(OnGameSceneLoadRequested);
GameEvents.OnGameSettingsApplied.Remove(ApplySettings);
}
~I came to the conclusion that something changed on KSP 1.12 (as this code war working fine at least on KSP 1.9.1, in which I also teste it) that children
is now null
on while loading KSP (the point in which this exception happened). I think that checking for null will solve this issue.
In a way or another, it's a KSP 1.12.x induced problem on Deep Freeze, and it need to be tackled down by code on DF itself.~
EDIT: I WAS WRONG!
from ksp-recall.
Setting it as unrelated by obvious reasons, and closing this.
from ksp-recall.
KSP is not at fault here. This is what was really happening.
The DeepFreezePart.OnDestroy (the PartModule) was the code borking, not the DeepFreeze.OnDestroy (the Scenario Module).
That log message completely misguided me. The real problem is on this code:
private void OnDestroy()
{
//Remove GameEvent callbacks.
Debug.Log("DeepFreezer OnDestroy");
GameEvents.onCrewTransferPartListCreated.Remove(onCrewTransferPartListCreated);
GameEvents.onCrewTransferred.Remove(onCrewTransferred);
GameEvents.onVesselChange.Remove(OnVesselChange);
GameEvents.onCrewBoardVessel.Remove(OnCrewBoardVessel);
GameEvents.onCrewOnEva.Remove(onCrewOnEva);
GameEvents.onVesselDestroy.Remove(onVesselDestroy);
GameEvents.OnCameraChange.Remove(OnCameraChange);
GameEvents.onVesselGoOffRails.Remove(onVesselGoOffRails);
GameEvents.onVesselCrewWasModified.Remove(OnVesselCrewModified);
DFGameEvents.onKerbalFrozen.Remove(OnKerbalFreezeThaw); // <— HERE!!!
DFGameEvents.onKerbalThaw.Remove(OnKerbalFreezeThaw);
GameEvents.onVesselSwitching.Remove(OnVesselSwitching);
if (onATPPodSettingChanged != null)
{
onATPPodSettingChanged.Remove(OnATPPodSettingChanged);
}
Debug.Log("DeepFreezer END OnDestroy");
}
The DGGameEvents
structure os initialised only on the class Textures
(whatahell??) on the Start
method, here:
Problem. Besides Textures being completely unrelated to the DFGameEvents, the Texture
MonoBehaviour
is started only on the Main Menu : [KSPAddon(KSPAddon.Startup.MainMenu, false)]
. So it's not a surprise that the DeepFreezePart
's OnDestroy
is borking, as the DFGameEvents
are all still NULL at that point!
The easiest way out of this huge mess is to initialise DFGameEvents
on the class loading, guaranteeing that the data structures will be immediately available for using.
The big question is not why DF started to throw exceptions now, but why it wasn't doing it before!
from ksp-recall.
A pull request was issued to the maintainer fixing the issue.
from ksp-recall.
Related Issues (20)
- 2 MM Errors with newest version HOT 1
- Weird Misbehaviour on Interstellar Technologies. HOT 26
- `AttachedOnEditor` is being screwed up when Merging crafts HOT 13
- Find a way to survive KSPCF's ~~Stupidity~~ *Less Than Smartness*. HOT 5
- unsure if reported already HOT 2
- Yet a new batch of displacement problems on KSP…. HOT 11
- Editor's ReRoot is screwed from KSP >= 1.8.0 HOT 8
- ScrapYard (et all) is being screwed by a Race Condition those origin is still unknown HOT 19
- Add an option to to not show the KSP-Recall entries on the PAW HOT 1
- KSP 1.12.5 (or a 3rd party add'on?) are not honouring the `once` attribute from the `KSPAddon` decoration HOT 3
- Rebalance (or not???) `size1p5` to use Attachment Nodes with Size 1 instead of 2 HOT 25
- Fix the Sanity Check report HOT 1
- Understand why `BetterEditorUndoRedo` ended up screwing `AttachedOnEditor` indirectly HOT 6
- Restore the KSP-Recall buttons on the PAW HOT 1
- 0.4.0.4 is screwing PAW HOT 4
- Implement the PAW's `DebugMode` properly HOT 1
- Refunding is not working on 1.12.x!!!! HOT 14
- Merge the `emergencial/0.5.0.0` into `dev`
- Check what can be done on Stage Recovery
- Merge Craft is getting its surface attachments screwed on 1.9.x and newer HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ksp-recall.