nixpkgs/pkgs/applications/misc/stardict/stardict-3.0.3-compositelookup_cpp.patch
Vladimír Čunát 1a33b4b654 Fixing stardict broken by my mistake.
svn path=/nixpkgs/trunk/; revision=34549
2012-06-18 15:37:35 +00:00

20 lines
863 B
Diff

This patch is from OpenSUSE .src.rpm for the following crash on startup:
ERROR:compositelookup.cpp:53:void CompositeLookup::send_net_dict_request(const string&, const string&): assertion failed: (NetDictRequests.end() == std::find(NetDictRequests.begin(), NetDictRequests.end(), request))
--- dict/src/lib/compositelookup.cpp
+++ dict/src/lib/compositelookup.cpp
@@ -50,8 +50,10 @@
void CompositeLookup::send_net_dict_request(const std::string& dict_id, const std::string& key)
{
NetDictRequest request(dict_id, key);
- g_assert(NetDictRequests.end() == std::find(NetDictRequests.begin(), NetDictRequests.end(), request));
- NetDictRequests.push_back(request);
+ if(NetDictRequests.end() == std::find(NetDictRequests.begin(), NetDictRequests.end(), request))
+ {
+ NetDictRequests.push_back(request);
+ }
}
/* returns true if got expected response */