sorting associative array's keys by values

Timon Gehr timon.gehr at gmx.ch
Sat Jun 16 12:51:15 PDT 2012


On 06/16/2012 07:51 PM, maarten van damme wrote:
> For some crazy reason my program now crashes on seemingly random
> locations when parsing content of the form:
> 	<div class="details">
> 	<h1 class="unique">randomname</h1>
> I want to extract randomname but an xml parser would be overkill so I
> extract it using
> curLine=curLine[curLine.countUntil(">")+1..$];
> curLine=curLine[0..curLine.countUntil("</")];
>
> with curLine containing the contents of the second line.
> When it crashes, it does so on the second instruction. I tried
> wrapping try{}catch around it but to no avail.
> I have no problem with it crashing, could be a logic mistake, but I
> really need to be able to rely on try{}catch...
>
> It's really strange because every string involved in the process is
> completely cleared and it fails sometimes on cases where it has no
> problems the other times.

Possibly memory corruption. Do you use any unsafe constructs?


More information about the Digitalmars-d-learn mailing list