Skip to content

ArgumentOutOfRangeException in BufferPool.cs #6

@liaody

Description

@liaody

There is a logic bug where i-- makes i go to -1. A proposed fix here:

--- a/FFTW.NET/BufferPool.cs
+++ b/FFTW.NET/BufferPool.cs
@@ -83,7 +83,7 @@ namespace FFTW.NET
                                                if (item.Size >= minSize)
                                                {
                                                        bufferPool._buffers.RemoveAt(i--);
-                                                       if (bufferPool._buffers[i].Buffer.TryGetTarget(out buffer))
+                                                       if (item.Buffer.TryGetTarget(out buffer))
                                                                break;
                                                }
                                        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions