<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
try to get backtrace and check what exactly is the reason of crash.<br>
<br>
<div class="moz-cite-prefix">14.08.2014 00:49, Samuli Silvius пишет:<br>
</div>
<blockquote
cite="mid:CABcJ=Qw73kyn0DRN3=6BBdjbLKB6S8e0y0VN+XWJsVmWguYT7g@mail.gmail.com"
type="cite">
<div dir="ltr">Hi,
<div><br>
</div>
<div>I have Canvas in Silica Dialog page but app crashes when
leaving dialog page both with accept or cancel swipe. It does
not crash always just quite often.</div>
<div><br>
</div>
<div>the code:</div>
<div>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">Canvas</span><span style="color:rgb(192,192,192)"> </span>{</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">id</span>:<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">imageCanvas</span></font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">visible</span>:<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">isImageUrl</span></font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">width</span>:<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">imgLoader</span>.sourceSize.width</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">height</span>:<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">imgLoader</span>.sourceSize.height</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">renderStrategy</span>:<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">Canvas</span>.Immediate</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">onPaint</span>:<span style="color:rgb(192,192,192)"> </span>{</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">var</span><span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(41,133,199)">ctx</span><span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">getContext</span>(<span style="color:rgb(0,128,0)">"2d"</span>)</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(41,133,199)">ctx</span>.drawImage(<span style="font-style:italic;color:rgb(0,0,0)">imgLoader</span>,<span style="color:rgb(192,192,192)"> </span>0,<span style="color:rgb(192,192,192)"> </span>0)</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"> }</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(192,192,192)"> </span>}
</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">Image</span><span style="color:rgb(192,192,192)"> </span>{</font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">id</span>:<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">imgLoader</span></font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">visible</span>:<span style="color:rgb(192,192,192)"> false</span></font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">source</span>:<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">isImageUrl</span><span style="color:rgb(192,192,192)"> </span>?<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">url</span><span style="color:rgb(192,192,192)"> </span>:<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">""</span></font></pre>
<pre style="margin-top:0px;margin-bottom:0px"><font face="courier new, monospace"><span style="color:rgb(192,192,192)"> </span>}</font></pre>
<pre style="margin-top:0px;margin-bottom:0px">
</pre>
</div>
<div>The idea is to save image to the gallery in <span
style="color:rgb(128,0,0)">onAccepted</span> if user has
selected that option as Canvas has save method which can be
used to save image to a file.</div>
<div><br>
</div>
<div>And it works fine, but causing app to crash sometimes when
leaving Dialog page with cancel swipe. SDK outputs a long
crash dump.</div>
<div><br>
</div>
<div>-Samuli</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to <a class="moz-txt-link-abbreviated" href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a></pre>
</blockquote>
<br>
</body>
</html>