Recent

Author Topic: SIGSEGV after copy of CheckBox  (Read 1739 times)

straetch

  • Jr. Member
  • **
  • Posts: 80
SIGSEGV after copy of CheckBox
« on: December 31, 2018, 10:45:43 am »
My program has a main form and two other forms (form1 and form2), called from main.
These two forms are similar, so I copy-pasted a Checkbox from form1's visual to form2's visual.
Both checkboxes have an OnChange procedure added to toggle the Checked property.
When the checkbox in form2 is clicked, then I get a SIGSEGV.
The identical checkbox in form1 behaves normally.
I tried to remove the checkbox from form2 and replaced it with a newly created checkbox with another name. Same result.
I then deleted form2 and it's unit entirely (see also note below), recreated it with another name and created a checkbox within the new form. Same result.
I suspect I should not have copy-pasted the checkbox in the first place.

How can I clean this up?

(Note: after form2 is deleted (project > remove from project, and manually deleting the files, I still find the unit in the lps file.)

wp

  • Hero Member
  • *****
  • Posts: 12909
Re: SIGSEGV after copy of CheckBox
« Reply #1 on: December 31, 2018, 10:59:35 am »
Both checkboxes have an OnChange procedure added to toggle the Checked property.
First of all: The checkbox toggles its Checked state automatically, there's no need to do this in the OnChange event handler. But I guess you are doing something else in the OnChange event which refers to something on Form1, but which is not available on Form2. But these are wild guesses, without code or - better - a compilable project nobody can give a definitive answer.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: SIGSEGV after copy of CheckBox
« Reply #2 on: December 31, 2018, 12:46:11 pm »
(Note: after form2 is deleted (project > remove from project, and manually deleting the files, I still find the unit in the lps file.)

That' is normal; after all you had the file open during the session (LPS ~= Lazarus Project Session).
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

 

TinyPortal © 2005-2018