kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #36110
Re: [PATCH]fix library cache issue
Looks good, Damien. I’ve pushed it to master. Thanks for your contribution!
Cheers,
Jeff.
> On 9 Jun 2018, at 09:21, Damien Espitallier <damien.espitallier@xxxxxxxxx> wrote:
>
> I have made another try.
>
> This time as the library timestamp is always use as library identifier, I add it with hash of the library name. The internal variable of the GenerateTimestamp function was already called "hash", so I guess it was the idea at first time.
> I didn't find any good hash function on the kicad source code except wxHashTable::MakeKey. The function sums all character to make an hash so library "ba" and library "ab" with have the same output. But at least it will prevent the bug 99% of the time.
>
>
>
> Damien
>
> 2018-06-08 23:43 GMT+02:00 Damien Espitallier <damien.espitallier@xxxxxxxxx <mailto:damien.espitallier@xxxxxxxxx>>:
> Thanks for your feedbacks, i will try to improve the patch
>
> Le ven. 8 juin 2018 22:29, Seth Hillbrand <seth.hillbrand@xxxxxxxxx <mailto:seth.hillbrand@xxxxxxxxx>> a écrit :
>
> Hi Damien-
>
> Library name is frequently NULL. This will segfault in your implementation.
>
> -S
>
>
> Am Fr., 8. Juni 2018 um 13:04 Uhr schrieb Damien Espitallier <damien.espitallier@xxxxxxxxx <mailto:damien.espitallier@xxxxxxxxx>>:
> Hi,
>
> I found a bug with the library browser.
>
> Step to reproduce:
> - open Kicad
> - open PCBNew
> - click on Load footprint from library
> - click on select by browser
> - select a library then quickly change to an another one
>
> => bug: the second category is selected but footprint list if for the first one.
> => bug2: selecting a footprint cause an assert: "/home/damien/prog/kicad-source-mirror/pcbnew/class_board.cpp(838): assert "Assert failure" failed in Add(): BOARD::Add() param error: aBoardItem NULL"
>
>
> The attached patch fix the issue by checking the library name in addition to the library timestamp.
>
> Damien Espitallier
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers <https://launchpad.net/~kicad-developers>
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~kicad-developers <https://launchpad.net/~kicad-developers>
> More help : https://help.launchpad.net/ListHelp <https://help.launchpad.net/ListHelp>
>
> <0001-Add-library-name-pseudo-hash-in-fp_list_table-Genera.patch>_______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers <https://launchpad.net/~kicad-developers>
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~kicad-developers <https://launchpad.net/~kicad-developers>
> More help : https://help.launchpad.net/ListHelp <https://help.launchpad.net/ListHelp>
References