It's possible to create a TfrmRVPara and pass nil to both constructor arguments. Unfortunately, there are several methods that assume that ControlPanel (the second parameter above) <> nil.
From looking at related code, it appears that this can be remedied by adding the following to FormCreate, before the first call to UpdateLengthSpinEdit (which is one of the methods that will crash otherwise):
if ControlPanel=nil then
ControlPanel := MainRVAControlPanel;
Access violation in ParaRVFrm
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 2
- Joined: Wed Jun 25, 2014 6:31 pm
Yes, the form is being created directly in the code in question. (I didn't write it; I'm just the guy who has to debug it.)
And yes, you can pass MainRVAControlPanel as a parameter... if you know about it. The point I'm making is that the constructor accepts nil as a parameter, which then leads to invalid behavior down the line. Either the constructor should raise an exception, or the object should assume the responsibility of correcting this internally.
And yes, you can pass MainRVAControlPanel as a parameter... if you know about it. The point I'm making is that the constructor accepts nil as a parameter, which then leads to invalid behavior down the line. Either the constructor should raise an exception, or the object should assume the responsibility of correcting this internally.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: