Discussion:
Crash when renaming categories (and possible fix)
Tobias Leupold
2014-07-06 08:11:36 UTC
Permalink
Hi list!

I found a crash situation in current git master. You can produce it like so:

* Open the "Categories" settings page
* Rename a category
* Click "Apply"
* Rename it again
* Click "Apply" again

--> KPA crashes.

I think this is due to _categoryOrig in CategoryItem.cpp not being set to the
current (updated) category name, but still pointing to the original name (it
is overwritten by the submit function).

I'm not perfectly sure if this is okay and works fine. It's only a tiny
change, but with this, the crash does not occur anymore and all renaming seems
still to be working:
https://github.com/l3u/kphotoalbum/compare/fix_rename_crash

Could you please review this?

Yours, Tobias
Johannes Zarl
2014-07-06 16:32:03 UTC
Permalink
Hi Tobias,

Thanks for the bugreport and analysis!

Looking into the CategoryItem code it turned out that the code had a bit of a
split-brain situation (some places used _text and others _category). Thus,
removing the redundancies fixed the root-cause of the bug...

Cheers,
Johannes
Post by Tobias Leupold
Hi list!
* Open the "Categories" settings page
* Rename a category
* Click "Apply"
* Rename it again
* Click "Apply" again
--> KPA crashes.
I think this is due to _categoryOrig in CategoryItem.cpp not being set to
the current (updated) category name, but still pointing to the original
name (it is overwritten by the submit function).
I'm not perfectly sure if this is okay and works fine. It's only a tiny
change, but with this, the crash does not occur anymore and all renaming
https://github.com/l3u/kphotoalbum/compare/fix_rename_crash
Could you please review this?
Yours, Tobias
_______________________________________________
KPhotoAlbum mailing list
https://mail.kdab.com/mailman/listinfo/kphotoalbum
Loading...