Author Topic: SCI Studio bug report  (Read 2925 times)

0 Members and 1 Guest are viewing this topic.

Offline sith

SCI Studio bug report
« on: March 27, 2003, 05:22:20 AM »
Hi,

I discovered a bug in SCI Studio 3.01

In the View editor I get the error "Canvas does not allow drawing", sometimes followed by the famous "Incorrect parameter" error.

This error occurs at random, so it's not easy to replicate. I'm running Win98SE.

Brian : Sorry to put this in the forum instead of e-mailing this, but I'm having email-troubles with my provider.

Greetz,

Jeroen



Offline Brian Provinciano

Re:SCI Studio bug report
« Reply #1 on: March 27, 2003, 05:47:11 AM »
Heh. All the bugs are due to Win98. hehe

Well, the good news is the traffic to my site last year was about 60% Win98, now it's about 60% WinXP. In all seriousness though, I will have them fixed when SCI Studio 3.1 is out since I'll do a lot of testing on a Win98 machine.

Offline sith

Re:SCI Studio bug report
« Reply #2 on: March 27, 2003, 06:00:12 AM »
Brian,

Make sure you test long enough. The bug I mentioned appeared after working more than an hour in the view-editor.

Offline Chris Cromer

Re:SCI Studio bug report
« Reply #3 on: March 27, 2003, 05:06:43 PM »
Yeah I used to use 98, but now I use XP. ;D

Let's just say... I am never going back, I love XP. :)
« Last Edit: March 27, 2003, 09:34:46 PM by Chris Cromer »
Chris Cromer

It's all fun and games until someone get's hurt then it's just fun. ;)

Offline Wilco

Re:SCI Studio bug report
« Reply #4 on: March 27, 2003, 08:37:25 PM »
I'm currently on Win95 and I've been having the same problem as Sith, in the view editor and picture editor. It does seem to just happen at random, "Canvas does not allow drawing" and "Paramater is ". The latter comes up a million times on my screen, so I have to press Ctrl + Alt + Delete to cancel SCI Studio on the taskmanager.
__________________
***Cat's Quest***
---Coming (Not So) Soon!---
__________________

Offline sith

Re:SCI Studio bug report
« Reply #5 on: March 28, 2003, 05:01:59 AM »
I've been doing some research myself  and it seems that this bug is probably still a memory leak.

The "canvas does not allow drawing" could indicate that you're not cleaning up all the DC's you're allocating. (as a result, Windows cannot provide you with a valid DC anymore. I think there is a limit to the number of DC's a program can allocate, but I'm not sure.)

Brian, when you go to the next cell in a loop, do you create a new DC to draw the next view or do you use  one DC that's updated every time ? In the first case, are you sure you free() the DC that's not in use anymore ?


Offline Brian Provinciano

Re:SCI Studio bug report
« Reply #6 on: March 28, 2003, 06:09:53 AM »
None of the Canvas errors come from my WinAPI. The Canvas is a Borland VCL component that locks itself sometimes, generating the error message. I will look into whether or not I can check if the canvas is locked before writing to it, possibly waiting for it to be ready to avoid the message. Borland's VCL is crap, but coding the whole UI in WinAPI would be like coding in assembly language.

Offline sith

Re:SCI Studio bug report
« Reply #7 on: March 28, 2003, 07:02:51 AM »
Brian,

I found a Delphi help-file on the web and since Delphi also uses the VCL I think most of it is applicable to the C++ components too.

The TCanvas class has a method called TryLock()

form the helpfile :

Quote
Locks the canvas if it is currently unlocked.

function TryLock: Boolean;

Description

Call TryLock to prevent other threads from writing on the surface of the canvas until the Unlock method is called. Unlike calls to the Lock method, which nest so that every call to Lock must be matched with a subsequent call to Unlock, TryLock need only be matched by a call to Unlock if the canvas was not already locked.

If the canvas is unlocked, TryLock locks the canvas, sets the LockCount property to 1, and returns True. If the canvas is already locked, TryLock returns False without making any changes.

Use TryLock before attempting changes to the canvas that could interfere with other code that is protected by a Lock ... Unlock pair of method calls.

I hope this helps you a little bit...

One question : Do you use multi-threading in SCI Studio ? Because if you do, you must be very careful with locking and unlocking resources.

Jeroen

PS : here are some free memory- and resourceleak-checkers http://www.thefreecountry.com/sourcecode/debugging.shtml
« Last Edit: March 28, 2003, 07:39:45 AM by sith »

Drigo

  • Guest
Re:SCI Studio bug report
« Reply #8 on: March 30, 2003, 12:06:21 PM »
 I guess it is e memory leak due to missing deallocations of memory just like Sith pointed 8)

In fact it happens in the font editor as well... to let it come out, you must display all the characters using the arrows, after having step through a pair dozen of chars you'll get the canvas error.

Also another bug happens when you change the font size, if you select the font size field bt don't change its value it is changed carelessy of your choice.

However, Brian rocks!   ;)


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.037 seconds with 18 queries.