[ardour-dev] [PATCH]ardour_region-overlap-crash.diff

Karsten Wiese annabellesgarden at yahoo.de
Wed Dec 29 10:36:30 PST 2004


Am Montag 27 Dezember 2004 20:51 schrieb Karsten Wiese:
> fewer crashes now here with recent cvs-snapshot :-)
> 
> >>>>>>
> @@ -190,6 +191,10 @@
>  void
>  Crossfade::refill ()
>  {
> +  if (0 == last_length) {
> +    cerr << " 000 !!!" << endl;
> +    return;
> +  }
>         double factor = length () / (double) last_length;
>  
>         _fade_out.x_scale (factor);
> <<<<<<
> 
> Karsten
> 
> 

dug a liitle deeper and found this as main part of attached new diff:
>>>>>
@@ -199,7 +213,7 @@
 jack_nframes_t
 Crossfade::length () const
 {
- return _left->last_frame() - _right->first_frame();
+ return _left->first_frame() + _left->length() - _right->first_frame();
 }
 
 void
<<<<<
The smallest overlap 1 made length() return 0, what led to memory corruption later on.

And a question:
If Crossfade::Crossfade() throws failed_constructor(), then the memory used by it's instance isn't freed, no?
To regain memory the exception transmitted should communicate the instance's this pointer and the catch handler would call delete on it?

Karsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ardour_region-overlap-crash.diff
Type: text/x-diff
Size: 1496 bytes
Desc: not available
URL: <http://lists.ardour.org/pipermail/ardour-dev-ardour.org/attachments/20041229/bd6f3476/attachment.diff>


More information about the Ardour-Dev mailing list