<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://endl.ch"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>ndl@home - Comments</title>
 <link>http://endl.ch</link>
 <description>Comments</description>
 <language>en</language>
<item>
 <title>Download and test cxx2rust</title>
 <link>http://endl.ch/content/cxx2rust-pains-wrapping-c-rust-example-qt5#comment-1341</link>
 <description>&lt;p&gt;In reply to &lt;a href=&quot;http://endl.ch/content/cxx2rust-pains-wrapping-c-rust-example-qt5&quot;&gt;cxx2rust: the pains of wrapping C++ in Rust on the example of Qt5&lt;/a&gt;:&lt;/p&gt;

 &lt;p&gt;Is there any links ? from where I can download cxx2rust on some other libraries and templates&lt;/p&gt;
 </description>
 <pubDate>Thu, 01 Oct 2015 17:01:24 +0000</pubDate>
 <dc:creator>Neel Basu</dc:creator>
 <guid isPermaLink="false">comment 1341 at http://endl.ch</guid>
</item>
<item>
 <title>Download and test cxx2rust</title>
 <link>http://endl.ch/content/cxx2rust-pains-wrapping-c-rust-example-qt5#comment-1340</link>
 <description>&lt;p&gt;In reply to &lt;a href=&quot;http://endl.ch/content/cxx2rust-pains-wrapping-c-rust-example-qt5&quot;&gt;cxx2rust: the pains of wrapping C++ in Rust on the example of Qt5&lt;/a&gt;:&lt;/p&gt;

 &lt;p&gt;Is there any links ? from where I can download cxx2rust on some other libraries and templates&lt;/p&gt;
 </description>
 <pubDate>Thu, 01 Oct 2015 16:58:45 +0000</pubDate>
 <dc:creator>Neel Basu</dc:creator>
 <guid isPermaLink="false">comment 1340 at http://endl.ch</guid>
</item>
<item>
 <title>Do you think things would go</title>
 <link>http://endl.ch/content/cxx2rust-pains-wrapping-c-rust-example-qt5#comment-1288</link>
 <description>&lt;p&gt;In reply to &lt;a href=&quot;http://endl.ch/content/cxx2rust-pains-wrapping-c-rust-example-qt5&quot;&gt;cxx2rust: the pains of wrapping C++ in Rust on the example of Qt5&lt;/a&gt;:&lt;/p&gt;

 &lt;p&gt;Do you think things would go better with modern Rust? I&#039;ve been wanting to use Qt in Rust for a while. Also, is the code for your bindings generator online somewhere?&lt;/p&gt;
 </description>
 <pubDate>Fri, 12 Jun 2015 21:11:00 +0000</pubDate>
 <dc:creator>Gulshan</dc:creator>
 <guid isPermaLink="false">comment 1288 at http://endl.ch</guid>
</item>
<item>
 <title>Any suggestions for ejabberd v14.05</title>
 <link>http://endl.ch/content/modarchiveodbc-release#comment-1281</link>
 <description>&lt;p&gt;In reply to &lt;a href=&quot;http://endl.ch/content/modarchiveodbc-release&quot;&gt;mod_archive_odbc release&lt;/a&gt;:&lt;/p&gt;

 &lt;p&gt;No, I&amp;#8217;m not aware of any &lt;span class=&quot;caps&quot;&gt;XEP&lt;/span&gt;-136 implementations for ejabberd &gt;&amp;nbsp;2.x&lt;/p&gt;
 </description>
 <pubDate>Thu, 10 Jul 2014 19:11:52 +0000</pubDate>
 <dc:creator>NDL</dc:creator>
 <guid isPermaLink="false">comment 1281 at http://endl.ch</guid>
</item>
<item>
 <title>Any suggestions for ejabberd v14.05</title>
 <link>http://endl.ch/content/modarchiveodbc-release#comment-1279</link>
 <description>&lt;p&gt;In reply to &lt;a href=&quot;http://endl.ch/content/modarchiveodbc-release&quot;&gt;mod_archive_odbc release&lt;/a&gt;:&lt;/p&gt;

 &lt;p&gt;Just got to know that mod_archive_odbc is not for v14.05 . Any suggestions what to do for this version.&lt;/p&gt;
 </description>
 <pubDate>Thu, 10 Jul 2014 15:38:16 +0000</pubDate>
 <dc:creator>Shobhit Singhal</dc:creator>
 <guid isPermaLink="false">comment 1279 at http://endl.ch</guid>
</item>
<item>
 <title>Identical messages</title>
 <link>http://endl.ch/content/modarchiveodbc-release#comment-1276</link>
 <description>&lt;p&gt;In reply to &lt;a href=&quot;http://endl.ch/content/modarchiveodbc-release&quot;&gt;mod_archive_odbc release&lt;/a&gt;:&lt;/p&gt;

 &lt;p&gt;Ну да, должны появляться: если контакту пришло N сообщений (неважно, на тот же ресурс или разные) то N сообщений и сохранится, а одинаковый текст или разный - это уже не модуля&amp;nbsp;дело.&lt;/p&gt;
 </description>
 <pubDate>Tue, 17 Jun 2014 20:40:40 +0000</pubDate>
 <dc:creator>NDL</dc:creator>
 <guid isPermaLink="false">comment 1276 at http://endl.ch</guid>
</item>
<item>
 <title>пользуюсь mod_archive_odbc на</title>
 <link>http://endl.ch/content/modarchiveodbc-release#comment-1275</link>
 <description>&lt;p&gt;In reply to &lt;a href=&quot;http://endl.ch/content/modarchiveodbc-release&quot;&gt;mod_archive_odbc release&lt;/a&gt;:&lt;/p&gt;

пользуюсь mod_archive_odbc на локалхосте, заметил проблему: когда пользователь залогинен с нескольких ресурсов, и оба эти ресурса получают одинаковое сообщение (так рассылает, например, google talk) -- то в БД, соответственно, появляются идентичные записи от разных ресурсов.

Как я понял из исходников, никаких средств контроля доступа к таблице archive_messages не предусмотрено?</description>
 <pubDate>Tue, 17 Jun 2014 16:40:24 +0000</pubDate>
 <dc:creator>Дмитрий</dc:creator>
 <guid isPermaLink="false">comment 1275 at http://endl.ch</guid>
</item>
<item>
 <title>&gt;  as hitting the mark “worse</title>
 <link>http://endl.ch/content/cxx2rust-pains-wrapping-c-rust-example-qt5#comment-1269</link>
 <description>&lt;p&gt;In reply to &lt;a href=&quot;http://endl.ch/content/cxx2rust-pains-wrapping-c-rust-example-qt5&quot;&gt;cxx2rust: the pains of wrapping C++ in Rust on the example of Qt5&lt;/a&gt;:&lt;/p&gt;

 &lt;p&gt;&amp;gt;  as hitting the mark “worse functional programming capabilities than in C++” is quite an “achievement” …&lt;/p&gt;
&lt;p&gt;Yes, Rust is pretty much dead. It started out pretty nice but then the people behind it got carried away by some &quot;beautiful type system&quot; nonsense and forgot about pragmatism. Now you have a bunch of type system enthusiasts being paid for playing in a chocolate factory.&lt;/p&gt;
 </description>
 <pubDate>Fri, 23 May 2014 08:02:58 +0000</pubDate>
 <dc:creator>Anonymous</dc:creator>
 <guid isPermaLink="false">comment 1269 at http://endl.ch</guid>
</item>
<item>
 <title>Optimisations and closures</title>
 <link>http://endl.ch/content/cxx2rust-pains-wrapping-c-rust-example-qt5#comment-1268</link>
 <description>&lt;p&gt;In reply to &lt;a href=&quot;http://endl.ch/content/cxx2rust-pains-wrapping-c-rust-example-qt5&quot;&gt;cxx2rust: the pains of wrapping C++ in Rust on the example of Qt5&lt;/a&gt;:&lt;/p&gt;

 &lt;p&gt;Are you compiling with optimisations (the -O flag or --opt-level=)? That should cause dead functions to be eliminated and so reduce the binary size.&lt;/p&gt;
&lt;p&gt;Also, the problems with closures are known, and it&#039;s being progressively improved (e.g. &lt;a href=&quot;https://github.com/rust-lang/rfcs/pull/77&quot; title=&quot;https://github.com/rust-lang/rfcs/pull/77&quot; rel=&quot;nofollow&quot;&gt;https://github.com/rust-lang/rfcs/pull/77&lt;/a&gt; ).&lt;/p&gt;
&lt;p&gt;By the way, your work-around has a very high risk of invoking undefined behaviour. The reason the compiler doesn&#039;t let you call a closure through &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&amp;amp;&lt;/code&gt;&lt;/span&gt; is because all mutations of aliased data need to go via the &lt;a href=&quot;http://doc.rust-lang.org/master/core/ty/struct.Unsafe.html&quot; rel=&quot;nofollow&quot;&gt;&lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;Unsafe&lt;/code&gt;&lt;/span&gt; type&lt;/a&gt; (or one of the wrappers, like &lt;a href=&quot;http://doc.rust-lang.org/master/core/cell/struct.RefCell.html&quot; rel=&quot;nofollow&quot;&gt;&lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;RefCell&lt;/code&gt;&lt;/span&gt;&lt;/a&gt; or &lt;a href=&quot;http://doc.rust-lang.org/master/core/cell/struct.Cell.html&quot; rel=&quot;nofollow&quot;&gt;&lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;Cell&lt;/code&gt;&lt;/span&gt;&lt;/a&gt;). Mutating via &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&amp;amp;&lt;/code&gt;&lt;/span&gt; without using &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;Unsafe&lt;/code&gt;&lt;/span&gt; is undefined behaviour (in the sense of C/C++) and the compiler may &quot;break&quot; your program.&lt;/p&gt;
&lt;p&gt;A closure can mutate its environment, hence calling one via &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&amp;amp;&lt;/code&gt;&lt;/span&gt; risks invoking undefined behaviour. However, it should be safe if you enforce that there are no captures (by giving the closure the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&#039;static&lt;/code&gt;&lt;/span&gt; lifetime, e.g. &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;|...|:&#039;static -&amp;gt; ...&lt;/code&gt;&lt;/span&gt;).&lt;/p&gt;
&lt;p&gt;It&#039;s worth mentioning that this does mean that implementing&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Things are getting even more complex if “mut” state for slots is allowed - up to the point I had to always use only non-mut and use RefCell&amp;lt;&amp;gt; for any mutable state that is accessed in slots.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;requires special care.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;The state is limited to only one variable. Multiple variables would complicate things even further by requiring to select the appropriate Callable struct implementation.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Rust has tuples (e.g. &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;(int, f64)&lt;/code&gt;&lt;/span&gt;) so you can have a state being multiple variables by capturing a tuple.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Surprisingly, the answer is “no”! Rust doesn’t even have member functions pointers! This means there’s no way to implement generic “callable” trait that would forward calls to the member function of your choice.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;A bare function pointer is writen &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;fn(...) -&amp;gt; ...&lt;/code&gt;&lt;/span&gt;. E.g.&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;pre class=&quot;text geshifilter-text&quot; style=&quot;font-family:monospace;&quot;&gt;struct Foo { f: fn(int) -&amp;gt; int }
&amp;nbsp;
fn increment(x: int) -&amp;gt; int { x + 1 }
&amp;nbsp;
fn main() {
    let foo = Foo { f: increment };
&amp;nbsp;
    println!(&amp;quot;{}&amp;quot;, (foo.f)(2));
}&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;There is some subtlety there, in that writing &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;foo.f(2)&lt;/code&gt;&lt;/span&gt; is always interpreted as a method call, so the parentheses are required to disambiguate.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;I didn’t manage to find the way to use lifetimes properly in “::new” functions. That is, in the examples above I have to construct the struct in two steps: calling “new” first and then “init” from the code that actually instantiates “DigitalClock” or “ImageViewer” structs, see lines 67 and 333 respectively.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;At a guess, this is probably due to the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&amp;amp;&#039;a self&lt;/code&gt;&lt;/span&gt; annotation on &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;init&lt;/code&gt;&lt;/span&gt;. This forces the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&#039;a&lt;/code&gt;&lt;/span&gt; lifetime of the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;ImageViewer&lt;/code&gt;&lt;/span&gt; to be the stack frame of &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;new&lt;/code&gt;&lt;/span&gt;, since that&#039;s where the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;ImageViewer&lt;/code&gt;&lt;/span&gt; struct is placed when you call &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;init&lt;/code&gt;&lt;/span&gt; (and hence the maximum time that the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&amp;amp;self&lt;/code&gt;&lt;/span&gt; reference passed to &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;init&lt;/code&gt;&lt;/span&gt; can last).&lt;/p&gt;
&lt;p&gt;Theoretically the correct fix would be removing the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&#039;a&lt;/code&gt;&lt;/span&gt; reference on the self reference, but I imagine that this would cause the captures of each slot to not last long enough. Another possible fix would be using a shared pointer equivalent (&lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;Rc&lt;/code&gt;&lt;/span&gt;) so that the captures do not need to have lifetimes like they have there... A third possible fix would be having some sort of action dispatcher on the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;ImageViewer&lt;/code&gt;&lt;/span&gt; type, which then passed a reference to itself into the action handler automatically (rather than &quot;manually&quot; capturing &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;self&lt;/code&gt;&lt;/span&gt; for each one). However, I imagine this last one is very hard when using a library that&#039;s not been designed for it.&lt;/p&gt;
&lt;p&gt;(BTW, I&#039;m having a lot of troubling getting past your captcha; it&#039;s very hard even for a human!)&lt;/p&gt;
 </description>
 <pubDate>Fri, 23 May 2014 05:25:36 +0000</pubDate>
 <dc:creator>Huon</dc:creator>
 <guid isPermaLink="false">comment 1268 at http://endl.ch</guid>
</item>
<item>
 <title>Optimisations and closures</title>
 <link>http://endl.ch/content/cxx2rust-pains-wrapping-c-rust-example-qt5#comment-1267</link>
 <description>&lt;p&gt;In reply to &lt;a href=&quot;http://endl.ch/content/cxx2rust-pains-wrapping-c-rust-example-qt5&quot;&gt;cxx2rust: the pains of wrapping C++ in Rust on the example of Qt5&lt;/a&gt;:&lt;/p&gt;

 &lt;p&gt;Are you compiling with optimisations (the -O flag or --opt-level=)? That should cause dead functions to be eliminated and so reduce the binary size.&lt;/p&gt;
&lt;p&gt;Also, the problems with closures are known, and it&#039;s being progressively improved (e.g. &lt;a href=&quot;https://github.com/rust-lang/rfcs/pull/77&quot; title=&quot;https://github.com/rust-lang/rfcs/pull/77&quot; rel=&quot;nofollow&quot;&gt;https://github.com/rust-lang/rfcs/pull/77&lt;/a&gt; ).&lt;/p&gt;
&lt;p&gt;By the way, your work-around has a very high risk of invoking undefined behaviour. The reason the compiler doesn&#039;t let you call a closure through &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&amp;amp;&lt;/code&gt;&lt;/span&gt; is because all mutations of aliased data need to go via the &lt;a href=&quot;http://doc.rust-lang.org/master/core/ty/struct.Unsafe.html&quot; rel=&quot;nofollow&quot;&gt;&lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;Unsafe&lt;/code&gt;&lt;/span&gt; type&lt;/a&gt; (or one of the wrappers, like &lt;a href=&quot;http://doc.rust-lang.org/master/core/cell/struct.RefCell.html&quot; rel=&quot;nofollow&quot;&gt;&lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;RefCell&lt;/code&gt;&lt;/span&gt;&lt;/a&gt; or &lt;a href=&quot;http://doc.rust-lang.org/master/core/cell/struct.Cell.html&quot; rel=&quot;nofollow&quot;&gt;&lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;Cell&lt;/code&gt;&lt;/span&gt;&lt;/a&gt;). Mutating via &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&amp;amp;&lt;/code&gt;&lt;/span&gt; without using &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;Unsafe&lt;/code&gt;&lt;/span&gt; is undefined behaviour (in the sense of C/C++) and the compiler may &quot;break&quot; your program.&lt;/p&gt;
&lt;p&gt;A closure can mutate its environment, hence calling one via &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&amp;amp;&lt;/code&gt;&lt;/span&gt; risks invoking undefined behaviour. However, it should be safe if you enforce that there are no captures (by giving the closure the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&#039;static&lt;/code&gt;&lt;/span&gt; lifetime, e.g. &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;|...|:&#039;static -&amp;gt; ...&lt;/code&gt;&lt;/span&gt;).&lt;/p&gt;
&lt;p&gt;It&#039;s worth mentioning that this does mean that implementing&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Things are getting even more complex if “mut” state for slots is allowed - up to the point I had to always use only non-mut and use RefCell&amp;lt;&amp;gt; for any mutable state that is accessed in slots.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;requires special care.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;The state is limited to only one variable. Multiple variables would complicate things even further by requiring to select the appropriate Callable struct implementation.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Rust has tuples (e.g. &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;(int, f64)&lt;/code&gt;&lt;/span&gt;) so you can have a state being multiple variables by capturing a tuple.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Surprisingly, the answer is “no”! Rust doesn’t even have member functions pointers! This means there’s no way to implement generic “callable” trait that would forward calls to the member function of your choice.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;A bare function pointer is writen &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;fn(...) -&amp;gt; ...&lt;/code&gt;&lt;/span&gt;. E.g.&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;pre class=&quot;text geshifilter-text&quot; style=&quot;font-family:monospace;&quot;&gt;struct Foo { f: fn(int) -&amp;gt; int }
&amp;nbsp;
fn increment(x: int) -&amp;gt; int { x + 1 }
&amp;nbsp;
fn main() {
    let foo = Foo { f: increment };
&amp;nbsp;
    println!(&amp;quot;{}&amp;quot;, (foo.f)(2));
}&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;There is some subtlety there, in that writing &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;foo.f(2)&lt;/code&gt;&lt;/span&gt; is always interpreted as a method call, so the parentheses are required to disambiguate.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;I didn’t manage to find the way to use lifetimes properly in “::new” functions. That is, in the examples above I have to construct the struct in two steps: calling “new” first and then “init” from the code that actually instantiates “DigitalClock” or “ImageViewer” structs, see lines 67 and 333 respectively.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;At a guess, this is probably due to the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&amp;amp;&#039;a self&lt;/code&gt;&lt;/span&gt; annotation on &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;init&lt;/code&gt;&lt;/span&gt;. This forces the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&#039;a&lt;/code&gt;&lt;/span&gt; lifetime of the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;ImageViewer&lt;/code&gt;&lt;/span&gt; to be the stack frame of &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;new&lt;/code&gt;&lt;/span&gt;, since that&#039;s where the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;ImageViewer&lt;/code&gt;&lt;/span&gt; struct is placed when you call &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;init&lt;/code&gt;&lt;/span&gt; (and hence the maximum time that the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&amp;amp;self&lt;/code&gt;&lt;/span&gt; reference passed to &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;init&lt;/code&gt;&lt;/span&gt; can last).&lt;/p&gt;
&lt;p&gt;Theoretically the correct fix would be removing the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;&#039;a&lt;/code&gt;&lt;/span&gt; reference on the self reference, but I imagine that this would cause the captures of each slot to not last long enough. Another possible fix would be using a shared pointer equivalent (&lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;Rc&lt;/code&gt;&lt;/span&gt;) so that the captures do not need to have lifetimes like they have there... A third possible fix would be having some sort of action dispatcher on the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;ImageViewer&lt;/code&gt;&lt;/span&gt; type, which then passed a reference to itself into the action handler automatically (rather than &quot;manually&quot; capturing &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;text geshifilter-text&quot;&gt;self&lt;/code&gt;&lt;/span&gt; for each one). However, I imagine this last one is very hard when using a library that&#039;s not been designed for it.&lt;/p&gt;
&lt;p&gt;(BTW, I&#039;m having a lot of troubling getting past your captcha; it&#039;s very hard even for a human!)&lt;/p&gt;
 </description>
 <pubDate>Fri, 23 May 2014 05:24:15 +0000</pubDate>
 <dc:creator>Huon</dc:creator>
 <guid isPermaLink="false">comment 1267 at http://endl.ch</guid>
</item>
</channel>
</rss>
