[fpc-pascal] TFPSMap return wrong pointer address

ik idokan at gmail.com
Thu Jan 31 20:35:34 CET 2013


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



More information about the fpc-pascal mailing list