Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-01

TFPSMap return wrong pointer address

3 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

ik

Hello,

I'm trying to use TFPSMap, to store a class using a key.

While the key seems to be saved properly, and easy to find, the data pointer that returns is wrong.
The adding of the data can be found here:
https://github.com/ik5/split_lazarus/blob/master/src/untlazsplitview_code.pas#L244

Here is the debug information that I can see it:

1. Saving:

TSplitView.ToggleSplitView -> ActiveEditor (00007FEEC39733C0) TSplitView.ToggleSplitView -> Looked for an item index: -1 TSplitView.ToggleSplitView -> No Item was found
TSplitView.ToggleSplitView -> Added new item index: 0 TSplitView.ToggleSplitView -> tab (00007FEEC1234C80), SplitEditor(00007FEEC218C610), Splitter (00007FEEC219CDD0) TSplitView.SetEditor -> Editor (00007FEEC218C610)
TSplitView.SetSplitter -> Splitter (00007FEEC219CDD0) TSplitView.ToggleSplitView -> done execution

2. Retrieving:
TSplitView.ToggleSplitView -> ActiveEditor (00007FEEC39733C0) TSplitView.ToggleSplitView -> Looked for an item index: 0 TSplitView.ToggleSplitView -> Found the item
TSplitView.ToggleSplitView -> tab (00007FEEBB2FCD00), SplitEditor(0000000000000000), Splitter (0000000000000000) TSplitView.ToggleSplitView -> CleanResources - Going to free SplitEditor (0000000000000000) and Splitter (0000000000000000) TSplitView.ToggleSplitView -> CleanResources - tab.SplitEditor is not allocated TSplitView.ToggleSplitView -> CleanResources - Going to free tab.Splitter TSplitView.SetEditor -> Editor (0000000000000000

Am I doing something wrong here ?
If so, what is the best way to solve it ?

Thanks,
Ido

ik
to ik
ik wrote 33 lines
Hello, I'm trying to use TFPSMap, to store a class using a key. While the key seems to be saved properly, and easy to find, the data pointer that returns is wrong. The adding of the data can be found here: https://github.com/ik5/split_lazarus/blob/master/src/untlazsplitview_code.pas#L244 Here is the debug information that I can see it: 1. Saving: TSplitView.ToggleSplitView -> ActiveEditor (00007FEEC39733C0) TSplitView.ToggleSplitView -> Looked for an item index: -1 TSplitView.ToggleSplitView -> No Item was found TSplitView.ToggleSplitView -> Added new item index: 0 TSplitView.ToggleSplitView -> tab (00007FEEC1234C80), SplitEditor(00007FEEC218C610), Splitter (00007FEEC219CDD0) TSplitView.SetEditor -> Editor (00007FEEC218C610) TSplitView.SetSplitter -> Splitter (00007FEEC219CDD0) TSplitView.ToggleSplitView -> done execution 2. Retrieving: TSplitView.ToggleSplitView -> ActiveEditor (00007FEEC39733C0) TSplitView.ToggleSplitView -> Looked for an item index: 0 TSplitView.ToggleSplitView -> Found the item TSplitView.ToggleSplitView -> tab (00007FEEBB2FCD00), SplitEditor(0000000000000000), Splitter (0000000000000000) TSplitView.ToggleSplitView -> CleanResources - Going to free SplitEditor (0000000000000000) and Splitter (0000000000000000) TSplitView.ToggleSplitView -> CleanResources - tab.SplitEditor is not allocated TSplitView.ToggleSplitView -> CleanResources - Going to free tab.Splitter

The above was wrong, the checking did find that it was not allocated, the text itself was wrong, and fixed it

Show quoted text 8 lines
TSplitView.SetEditor -> Editor (0000000000000000 Am I doing something wrong here ? If so, what is the best way to solve it ? Thanks, Ido
ik
to ik
ik wrote 40 lines
On Thu, Jan 31, 2013 at 9:35 PM, ik wrote: > Hello, > > I'm trying to use TFPSMap, to store a class using a key. > > While the key seems to be saved properly, and easy to find, the data > pointer that returns is wrong. > The adding of the data can be found here: > https://github.com/ik5/split_lazarus/blob/master/src/untlazsplitview_code.pas#L244 > > Here is the debug information that I can see it: > > 1. Saving: > > TSplitView.ToggleSplitView -> ActiveEditor (00007FEEC39733C0) > TSplitView.ToggleSplitView -> Looked for an item index: -1 > TSplitView.ToggleSplitView -> No Item was found > TSplitView.ToggleSplitView -> Added new item index: 0 > TSplitView.ToggleSplitView -> tab (00007FEEC1234C80), > SplitEditor(00007FEEC218C610), Splitter (00007FEEC219CDD0) > TSplitView.SetEditor -> Editor (00007FEEC218C610) > TSplitView.SetSplitter -> Splitter (00007FEEC219CDD0) > TSplitView.ToggleSplitView -> done execution > > 2. Retrieving: > TSplitView.ToggleSplitView -> ActiveEditor (00007FEEC39733C0) > TSplitView.ToggleSplitView -> Looked for an item index: 0 > TSplitView.ToggleSplitView -> Found the item > TSplitView.ToggleSplitView -> tab (00007FEEBB2FCD00), > SplitEditor(0000000000000000), Splitter (0000000000000000) > TSplitView.ToggleSplitView -> CleanResources - Going to free > SplitEditor (0000000000000000) and Splitter (0000000000000000) > TSplitView.ToggleSplitView -> CleanResources - tab.SplitEditor is not allocated > TSplitView.ToggleSplitView -> CleanResources - Going to free tab.Splitter The above was wrong, the checking did find that it was not allocated, the text itself was wrong, and fixed it > TSplitView.SetEditor -> Editor (0000000000000000 >

Forgot to mention: FPC 2.6.0 with Arch Linux 64 bit

Show quoted text 6 lines
> Am I doing something wrong here ? > If so, what is the best way to solve it ? > > > Thanks, > Ido