[fpc-pascal] Re: TFPSMap return wrong pointer address

ik idokan at gmail.com
Thu Jan 31 22:41:24 CET 2013


On Thu, Jan 31, 2013 at 9:44 PM, ik <idokan at gmail.com> wrote:
> On Thu, Jan 31, 2013 at 9:35 PM, ik <idokan at gmail.com> 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

>> 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